<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:System="clr-namespace:System;assembly=mscorlib" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:Fluent="clr-namespace:Fluent" mc:Ignorable="d" xmlns:Diagnostics="clr-namespace:System.Diagnostics;assembly=WindowsBase" xmlns:PresentationOptions="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options">
  <SolidColorBrush x:Key="RibbonTopBorderBrush" Color="#FF5E5E5E" />
  <LinearGradientBrush x:Key="RibbonBackgoundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FFC9C9C9" Offset="0.53" />
    <GradientStop Color="#FFA3A3A3" Offset="1" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="ActiveTabBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FFCFCFCF" Offset="0" />
    <GradientStop Color="#FFC9C9C9" Offset="1" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="GroupSeparatorBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FFB8B8B8" Offset="0" />
    <GradientStop Color="#FF525252" Offset="1" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="GroupSeparatorBorderBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FFCBCBCB" Offset="0" />
    <GradientStop Color="#FFAFAFAF" Offset="1" />
  </LinearGradientBrush>
  <SolidColorBrush x:Key="DefaultFontBrush" Color="#FF000000" />
  <SolidColorBrush x:Key="BackstageFontBrush" Color="#FFFFFFFF" />
  <SolidColorBrush x:Key="GroupBoxFontBrush" Color="#FF242424" />
  <SolidColorBrush x:Key="TabItemSelectedFontBrush" Color="#FF212121" />
  <SolidColorBrush x:Key="TabItemFontBrush" Color="#FFE2E2E2" />
  <LinearGradientBrush x:Key="GroupHoverBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FFC7C7C7" Offset="0" />
    <GradientStop Color="#FFB6B6B6" Offset="1" />
  </LinearGradientBrush>
  <RadialGradientBrush x:Key="GroupHighlightBrush" Center="0.505,1" GradientOrigin="0.505,1">
    <GradientStop Color="#55FFFFFF" />
    <GradientStop Offset="1" />
  </RadialGradientBrush>
  <LinearGradientBrush x:Key="StatusBarBorderBrushBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FF2C2C2C" Offset="0" />
    <GradientStop Color="#FF323232" Offset="1" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="StatusBarInnerBorderBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FF595959" Offset="0" />
    <GradientStop Color="#FF333333" Offset="1" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="StatusBarInnerBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FF494949" Offset="0" />
    <GradientStop Color="#FF343434" Offset="1" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="StatusBarSeparatorBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FF595959" Offset="0" />
    <GradientStop Color="#FF373737" Offset="1" />
    <GradientStop Color="#FF020202" Offset="0.5" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="StatusBarSeparatorBorderBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FF525252" Offset="0" />
    <GradientStop Color="#FF404040" Offset="1" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="WindowBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FF6F6F6F" Offset="0" />
    <GradientStop Color="#FF3E3E3E" Offset="1" />
  </LinearGradientBrush>
  <SolidColorBrush x:Key="ScrollOutterBorderBrush" Color="#FF242424" />
  <SolidColorBrush x:Key="ScrollOutterBackgroundBrush" Color="#FF4A4A4A" />
  <LinearGradientBrush x:Key="ScrollInnerBorderBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FF747474" Offset="0" />
    <GradientStop Color="#FF555555" Offset="1" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="ScrollInnerBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FF737373" Offset="0" />
    <GradientStop Color="#FF555555" Offset="1" />
  </LinearGradientBrush>
  <SolidColorBrush x:Key="ScrollOverOutterBorderBrush" Color="#FF242424" />
  <SolidColorBrush x:Key="ScrollOverOutterBackgroundBrush" Color="#FF7F7F7F" />
  <LinearGradientBrush x:Key="ScrollOverInnerBorderBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FF7F7F7F" Offset="0" />
    <GradientStop Color="#FF6E6E6E" Offset="1" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="ScrollOverInnerBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FF818181" Offset="0" />
    <GradientStop Color="#FF626262" Offset="1" />
  </LinearGradientBrush>
  <SolidColorBrush x:Key="ScrollPressedOutterBorderBrush" Color="#FF242424" />
  <SolidColorBrush x:Key="ScrollPressedOutterBackgroundBrush" Color="#FF5B5B5B" />
  <LinearGradientBrush x:Key="ScrollPressedInnerBorderBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FF6B6B6B" Offset="0" />
    <GradientStop Color="#FF4E4E4E" Offset="1" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="ScrollPressedInnerBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FF696969" Offset="0" />
    <GradientStop Color="#FF515151" Offset="1" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="ScrollBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FF636363" Offset="0" />
    <GradientStop Color="#FF686868" Offset="1" />
  </LinearGradientBrush>
  <SolidColorBrush x:Key="ScrollVerticalOutterBorderBrush" Color="#FF242424" />
  <SolidColorBrush x:Key="ScrollVerticalOutterBackgroundBrush" Color="#FF4A4A4A" />
  <LinearGradientBrush x:Key="ScrollVerticalInnerBorderBrush" EndPoint="1,0.5" StartPoint="0,0.5">
    <GradientStop Color="#FF747474" Offset="0" />
    <GradientStop Color="#FF555555" Offset="1" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="ScrollVerticalInnerBackgroundBrush" EndPoint="1,0.5" StartPoint="0,0.5">
    <GradientStop Color="#FF737373" Offset="0" />
    <GradientStop Color="#FF555555" Offset="1" />
  </LinearGradientBrush>
  <SolidColorBrush x:Key="ScrollVerticalOverOutterBorderBrush" Color="#FF242424" />
  <SolidColorBrush x:Key="ScrollVerticalOverOutterBackgroundBrush" Color="#FF7F7F7F" />
  <LinearGradientBrush x:Key="ScrollVerticalOverInnerBorderBrush" EndPoint="1,0.5" StartPoint="0,0.5">
    <GradientStop Color="#FF7F7F7F" Offset="0" />
    <GradientStop Color="#FF6E6E6E" Offset="1" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="ScrollVerticalOverInnerBackgroundBrush" EndPoint="1,0.5" StartPoint="0,0.5">
    <GradientStop Color="#FF818181" Offset="0" />
    <GradientStop Color="#FF626262" Offset="1" />
  </LinearGradientBrush>
  <SolidColorBrush x:Key="ScrollVerticalPressedOutterBorderBrush" Color="#FF242424" />
  <SolidColorBrush x:Key="ScrollVerticalPressedOutterBackgroundBrush" Color="#FF5B5B5B" />
  <LinearGradientBrush x:Key="ScrollVerticalPressedInnerBorderBrush" EndPoint="1,0.5" StartPoint="0,0.5">
    <GradientStop Color="#FF6B6B6B" Offset="0" />
    <GradientStop Color="#FF4E4E4E" Offset="1" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="ScrollVerticalPressedInnerBackgroundBrush" EndPoint="1,0.5" StartPoint="0,0.5">
    <GradientStop Color="#FF696969" Offset="0" />
    <GradientStop Color="#FF515151" Offset="1" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="ScrollVerticalBackgroundBrush" EndPoint="1,0.5" StartPoint="0,0.5">
    <GradientStop Color="#FF636363" Offset="0" />
    <GradientStop Color="#FF686868" Offset="1" />
  </LinearGradientBrush>
  <SolidColorBrush x:Key="TextBoxBackgroundBrush" Color="#FFC6C6C6" />
  <SolidColorBrush x:Key="TextBoxHoverBackgroundBrush" Color="#FFCCCCCC" />
  <SolidColorBrush x:Key="TextBoxBorderBrush" Color="#FF919191" />
  <SolidColorBrush x:Key="TextBoxHoverBorderBrush" Color="#FF919191" />
  <SolidColorBrush x:Key="TextBoxDisabledBackgroundBrush" Color="#FFB6B6B6" />
  <SolidColorBrush x:Key="TextBoxDisabledBorderBrush" Color="#FFA0A0A0" />
  <SolidColorBrush x:Key="InRibbonGalleryBorderBrush" Color="#FF848484" />
  <SolidColorBrush x:Key="GalleryBackgroundBrush" Color="#FFBBBBBB" />
  <RadialGradientBrush x:Key="RibbonTabControlTopGradientLeftBrush" RadiusY="1" Center="1,1" GradientOrigin="1,1" RadiusX="1">
    <GradientStop Offset="1" Color="#00484848" />
    <GradientStop Color="#D8484848" />
  </RadialGradientBrush>
  <RadialGradientBrush x:Key="RibbonTabControlTopGradientRightBrush" RadiusY="1" Center="0,1" GradientOrigin="0,1" RadiusX="1">
    <GradientStop Offset="1" Color="#00484848" />
    <GradientStop Color="#D8484848" />
  </RadialGradientBrush>
  <LinearGradientBrush x:Key="RibbonTabControlTopGradientCenterBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Offset="0" Color="#00484848" />
    <GradientStop Color="#D8484848" Offset="1" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="BackstagePanelBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FF717171" Offset="0" />
    <GradientStop Color="#FF3B3B3B" Offset="1" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="ButtonBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FFE2E2E2" Offset="0" />
    <GradientStop Color="#FFB4B4B4" Offset="1" />
  </LinearGradientBrush>
  <SolidColorBrush x:Key="ButtonBorderBrush" Color="#FF919191" />
  <SolidColorBrush x:Key="ButtonDisabledBackgroundBrush" Color="#FFB6B6B6" />
  <SolidColorBrush x:Key="ButtonDisabledBorderBrush" Color="#FFA0A0A0" />
  <LinearGradientBrush x:Key="RibbonSeparatorBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FF525252" Offset="0.522" />
    <GradientStop Color="#66525252" />
    <GradientStop Color="#66525252" Offset="1" />
    <GradientStop Color="#99525252" Offset="0.168" />
    <GradientStop Color="#99525252" Offset="0.828" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="RibbonSeparatorBorderBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Offset="1" Color="#19FFFFFF" />
    <GradientStop Color="#19EFEFEF" />
    <GradientStop Color="#33F6F6F6" Offset="0.237" />
    <GradientStop Color="#33FBFBFB" Offset="0.741" />
  </LinearGradientBrush>
  <SolidColorBrush x:Key="WindowOutterBackgroundBrush" Color="#FF717171" />
  <SolidColorBrush x:Key="WindowOutterBorderBrush" Color="#FF636363" />
  <SolidColorBrush x:Key="WindowInnerBorderBrush" Color="#FF838383" />
  <LinearGradientBrush x:Key="WindowInnerBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FF797979" Offset="0" />
    <GradientStop Color="#FF717171" Offset="1" />
  </LinearGradientBrush>
  <SolidColorBrush x:Key="WindowContentBorderBrush" Color="#FF323131" />
  <SolidColorBrush x:Key="WindowInactiveOutterBackgroundBrush" Color="#FF9E9E9E" />
  <LinearGradientBrush x:Key="WindowInactiveInnerBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FF9E9E9E" Offset="0" />
    <GradientStop Color="#FF9E9E9E" Offset="1" />
  </LinearGradientBrush>
  <SolidColorBrush x:Key="CaptionButtonHoverOutterBorderBrush" Color="#FF515151" />
  <LinearGradientBrush x:Key="CaptionButtonHoverInnerBorderBrush">
    <GradientStop Color="#FF949494" Offset="0" />
    <GradientStop Color="#FF777777" Offset="1" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="CaptionButtonHoverInnerBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FF929292" Offset="0" />
    <GradientStop Color="#FF7A7A7A" Offset="1" />
    <GradientStop Offset="0.49" Color="#FF8B8B8B" />
    <GradientStop Offset="0.51" Color="#FF858585" />
  </LinearGradientBrush>
  <SolidColorBrush x:Key="CaptionButtonPressedOutterBorderBrush" Color="#FF515151" />
  <SolidColorBrush x:Key="CaptionButtonPressedInnerBorderBrush" Color="#FF606060" />
  <LinearGradientBrush x:Key="CaptionButtonPressedInnerBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FF6D6D6D" Offset="0" />
    <GradientStop Color="#FF6D6D6D" Offset="1" />
  </LinearGradientBrush>
  <SolidColorBrush x:Key="ContextMenuBarResizeBorderBrush" Color="#FFE1E1E1" />
  <LinearGradientBrush x:Key="ContextMenuBarResizeBackgoundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FFE2E2E2" Offset="0" />
    <GradientStop Color="#FFC4C4C4" Offset="1" />
    <GradientStop Color="#FFD7D7D7" Offset="0.529" />
  </LinearGradientBrush>
  <SolidColorBrush x:Key="ScreenTipBorderBrush" Color="#FF767676" />
  <LinearGradientBrush x:Key="ScreenTipBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="White" Offset="0" />
    <GradientStop Color="#FFE5E5F0" Offset="1" />
    <GradientStop Color="#FFECECF4" Offset="0.746" />
  </LinearGradientBrush>
  <SolidColorBrush x:Key="QuickAccessToolbarPopupBackgrondBrush" Color="#FFA1A1A1" />
  <SolidColorBrush x:Key="QuickAccessToolBarOutterBorderBrush" Color="#FF4E4E4E" />
  <SolidColorBrush x:Key="QuickAccessToolBarInnerBorderBrush" Color="#FF848484" />
  <SolidColorBrush x:Key="QuickAccessToolBarInnerBackgroundBrush" Color="#FF797979" />
  <LinearGradientBrush x:Key="GroupBoxSeparatorBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FF919191" Offset="0" />
    <GradientStop Color="#FF787878" Offset="1" />
    <GradientStop Color="#FF545454" Offset="0.5" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="GroupBoxSeparatorBorderBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FFCACACA" Offset="0" />
    <GradientStop Color="#FFC3C3C3" Offset="1" />
    <GradientStop Color="#FFCCCCCC" Offset="0.5" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="RoundButtonBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FFBBBBBB" Offset="0" />
    <GradientStop Color="#FF6B6B6B" Offset="1" />
  </LinearGradientBrush>
  <SolidColorBrush x:Key="RoundButtonBorderBrush" Color="#1C1C1C" />
  <SolidColorBrush x:Key="SliderShadowBrush" Color="#262626" />
  <SolidColorBrush x:Key="SliderLightenBrush" Color="#575757" />
  <LinearGradientBrush x:Key="RoundButtonForegroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FF333333" Offset="0" />
    <GradientStop Color="#FF333333" Offset="1" />
  </LinearGradientBrush>
  <SolidColorBrush x:Key="ResizeGripFront" Color="#FF1B1B1B" />
  <SolidColorBrush x:Key="ResizeGripBack" Color="#FF595959" />
  <FontFamily x:Key="DefaultFontFamily">Segoe UI</FontFamily>
  <System:Double x:Key="DefaultFontSize">11</System:Double>
  <SolidColorBrush x:Key="BackstageBackgroundBrush" Color="White" />
  <LinearGradientBrush x:Key="BackstagePanelShadowBackgroundBrush" EndPoint="1.012,0">
    <GradientStop Color="#00000000" Offset="0" />
    <GradientStop Color="#19000000" Offset="1" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="BackstageTopBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#3FFFFFFF" Offset="0.49" />
    <GradientStop Color="#3F000000" Offset="0.5" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="BackstageTopOpacityBrush" EndPoint="1,0.5" StartPoint="0,0.5">
    <GradientStop Color="Black" Offset="0" />
    <GradientStop Offset="1" />
  </LinearGradientBrush>
  <SolidColorBrush x:Key="ButtonHoverOuterBackgroundBrush" Color="#FFF4DC91" />
  <LinearGradientBrush x:Key="ButtonHoverOuterBorderBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FFF1CA58" Offset="0" />
    <GradientStop Color="#FFF4D549" Offset="1" />
    <GradientStop Color="#FFF2CF50" Offset="0.75" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="ButtonHoverInnerBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FFFDEEB3" Offset="0" />
    <GradientStop Color="#FFFBF2CD" Offset="1" />
    <GradientStop Color="#FFFCE48A" Offset="0.5" />
    <GradientStop Color="#FFFBE388" Offset="0.75" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="ButtonHoverInnerBorderBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FFFDF9E8" Offset="0" />
    <GradientStop Color="#FFFDFDEB" Offset="1" />
    <GradientStop Color="#FFFDF4D7" Offset="0.75" />
  </LinearGradientBrush>
  <SolidColorBrush x:Key="ButtonPressedOuterBackgroundBrush" Color="#FFDCA351" />
  <LinearGradientBrush x:Key="ButtonPressedOuterBorderBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FFC2762B" Offset="0" />
    <GradientStop Color="#FFC29E47" Offset="1" />
    <GradientStop Color="#FFC28636" Offset="0.5" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="ButtonPressedInnerBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FFFAD577" Offset="0" />
    <GradientStop Color="#FFFEE287" Offset="1" />
    <GradientStop Color="#FFFEE287" Offset="0.5" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="ButtonPressedInnerBorderBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FFF6C867" Offset="0" />
    <GradientStop Color="#FFFAD77A" Offset="1" />
    <GradientStop Color="#FFF8D172" Offset="0.5" />
  </LinearGradientBrush>
  <SolidColorBrush x:Key="TransparentBrush" Color="#00000000" />
  <SolidColorBrush x:Key="CheckBoxOutterBorderBrush" Color="#FF898B8C" />
  <SolidColorBrush x:Key="CheckBoxOutterBackgroundBrush" Color="#FFF2F3F5" />
  <SolidColorBrush x:Key="CheckBoxInnerBorderBrush" Color="#FFB6B8BA" />
  <LinearGradientBrush x:Key="CheckBoxInnerBackgroundBrush" EndPoint="0.859,0.848" StartPoint="0.141,0.152">
    <GradientStop Color="#FFE8E9EB" Offset="0" />
    <GradientStop Color="#FFF0F1F2" Offset="1" />
  </LinearGradientBrush>
  <SolidColorBrush x:Key="CheckBoxHoverOutterBorderBrush" Color="#FFCF9037" />
  <SolidColorBrush x:Key="CheckBoxHoverOutterBackgroundBrush" Color="#FFFCF1C2" />
  <LinearGradientBrush x:Key="CheckBoxHoverInnerBorderBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FFFCAD5D" Offset="0" />
    <GradientStop Color="#FFFDCC9B" Offset="1" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="CheckBoxHoverInnerBackgroundBrush" EndPoint="0.859,0.848" StartPoint="0.141,0.152">
    <GradientStop Color="#FFFAECC8" Offset="0" />
    <GradientStop Color="#FFFCF3DD" Offset="1" />
  </LinearGradientBrush>
  <SolidColorBrush x:Key="CheckBoxPressedOutterBorderBrush" Color="#FFC26D1D" />
  <SolidColorBrush x:Key="CheckBoxPressedOutterBackgroundBrush" Color="#FFFCE7BD" />
  <LinearGradientBrush x:Key="CheckBoxPressedInnerBorderBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FFFCA558" Offset="0" />
    <GradientStop Color="#FFFDCB9F" Offset="1" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="CheckBoxPressedInnerBackgroundBrush" EndPoint="0.859,0.848" StartPoint="0.141,0.152">
    <GradientStop Color="#FFFAE0A2" Offset="0" />
    <GradientStop Color="#FFFCEDC9" Offset="1" />
  </LinearGradientBrush>
  <SolidColorBrush x:Key="GalleryBorderBrush" Color="#FFE2E4E7" />
  <SolidColorBrush x:Key="GalleryHeaderBackgroundBrush" Color="#FF959595" />
  <LinearGradientBrush x:Key="KeyTipBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="White" Offset="0" />
    <GradientStop Color="#FFEAEAF4" Offset="1" />
    <GradientStop Color="#FFF6F6FA" Offset="0.746" />
  </LinearGradientBrush>
  <SolidColorBrush x:Key="KeyTipBorderBrush" Color="#FF767676" />
  <SolidColorBrush x:Key="MenuItemCheckBoxBackgroundBrush" Color="#FFFCF1C2" />
  <SolidColorBrush x:Key="MenuItemCheckBoxBorderBrush" Color="#FFF29536" />
  <SolidColorBrush x:Key="ContextMenuBarBackgroundBrush" Color="White" />
  <SolidColorBrush x:Key="ContextMenuBarBorderBrush" Color="#FFA7ABB0" />
  <SolidColorBrush x:Key="ContextMenuLineBrush" Color="#FFE2E4E7" />
  <SolidColorBrush x:Key="ContextMenuSeparatorBrush" Color="#FFC7C8C9" />
  <SolidColorBrush x:Key="ScrollViewerButtonBorderBrush" Color="#FF79848C" />
  <LinearGradientBrush x:Key="ScrollViewerButtonBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="White" Offset="0" />
    <GradientStop Color="#FFE8EBEF" Offset="1" />
  </LinearGradientBrush>
  <SolidColorBrush x:Key="CaptionButtonCloseHoverOutterBorderBrush" Color="#FF9B3D3D" />
  <LinearGradientBrush x:Key="CaptionButtonCloseHoverInnerBorderBrush">
    <GradientStop Color="#FFFF8482" Offset="0" />
    <GradientStop Color="#FFEF7070" Offset="1" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="CaptionButtonCloseHoverInnerBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FFFF8483" Offset="0" />
    <GradientStop Color="#FFE36162" Offset="1" />
  </LinearGradientBrush>
  <SolidColorBrush x:Key="CaptionButtonClosePressedOutterBorderBrush" Color="#FF9B3D3D" />
  <SolidColorBrush x:Key="CaptionButtonClosePressedInnerBorderBrush" Color="#FFDA6163" />
  <LinearGradientBrush x:Key="CaptionButtonClosePressedInnerBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FFEA7070" Offset="0" />
    <GradientStop Color="#FFEA7070" Offset="1" />
  </LinearGradientBrush>
  <SolidColorBrush x:Key="ScrollWhiteOutterBorderBrush" Color="#FF8A9199" />
  <SolidColorBrush x:Key="ScrollWhiteOutterBackgroundBrush" Color="#FFD9DEE3" />
  <LinearGradientBrush x:Key="ScrollWhiteInnerBorderBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FFF0F4F8" Offset="0" />
    <GradientStop Color="#FFD7DBE1" Offset="1" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="ScrollWhiteInnerBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FFEFF3F7" Offset="0" />
    <GradientStop Color="#FFDADEE4" Offset="1" />
  </LinearGradientBrush>
  <SolidColorBrush x:Key="ScrollWhiteOverOutterBorderBrush" Color="#FF969EA8" />
  <SolidColorBrush x:Key="ScrollWhiteOverOutterBackgroundBrush" Color="#FFE5E9EB" />
  <LinearGradientBrush x:Key="ScrollWhiteOverInnerBorderBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FFFCFDFE" Offset="0" />
    <GradientStop Color="#FFF1F3F5" Offset="1" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="ScrollWhiteOverInnerBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FFF7FAFC" Offset="0" />
    <GradientStop Color="#FFE4E8EC" Offset="1" />
  </LinearGradientBrush>
  <SolidColorBrush x:Key="ScrollWhitePressedOutterBorderBrush" Color="#FFAEB3B8" />
  <SolidColorBrush x:Key="ScrollWhitePressedOutterBackgroundBrush" Color="#FFD6D7D9" />
  <LinearGradientBrush x:Key="ScrollWhitePressedInnerBorderBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FFE1E2E3" Offset="0" />
    <GradientStop Color="#FFE1E2E3" Offset="1" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="ScrollWhitePressedInnerBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FFE1E2E3" Offset="0" />
    <GradientStop Color="#FFE1E2E3" Offset="1" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="ScrollWhiteBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FFE1E2E3" Offset="0" />
    <GradientStop Color="#FFEFEFEF" Offset="0.05" />
    <GradientStop Color="#FFEFEFEF" Offset="0.95" />
    <GradientStop Color="#FFEBEDEF" Offset="1" />
  </LinearGradientBrush>
  <SolidColorBrush x:Key="ScrollWhiteVerticalOutterBorderBrush" Color="#FF8A9199" />
  <SolidColorBrush x:Key="ScrollWhiteVerticalOutterBackgroundBrush" Color="#FFD9DEE3" />
  <LinearGradientBrush x:Key="ScrollWhiteVerticalInnerBorderBrush" EndPoint="1,0.5" StartPoint="0,0.5">
    <GradientStop Color="#FFF0F4F8" Offset="0" />
    <GradientStop Color="#FFD7DBE1" Offset="1" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="ScrollWhiteVerticalInnerBackgroundBrush" EndPoint="1,0.5" StartPoint="0,0.5">
    <GradientStop Color="#FFEFF3F7" Offset="0" />
    <GradientStop Color="#FFDADEE4" Offset="1" />
  </LinearGradientBrush>
  <SolidColorBrush x:Key="ScrollWhiteVerticalOverOutterBorderBrush" Color="#FF969EA8" />
  <SolidColorBrush x:Key="ScrollWhiteVerticalOverOutterBackgroundBrush" Color="#FFE5E9EB" />
  <LinearGradientBrush x:Key="ScrollWhiteVerticalOverInnerBorderBrush" EndPoint="1,0.5" StartPoint="0,0.5">
    <GradientStop Color="#FFFCFDFE" Offset="0" />
    <GradientStop Color="#FFF1F3F5" Offset="1" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="ScrollWhiteVerticalOverInnerBackgroundBrush" EndPoint="1,0.5" StartPoint="0,0.5">
    <GradientStop Color="#FFF7FAFC" Offset="0" />
    <GradientStop Color="#FFE4E8EC" Offset="1" />
  </LinearGradientBrush>
  <SolidColorBrush x:Key="ScrollWhiteVerticalPressedOutterBorderBrush" Color="#FFAEB3B8" />
  <SolidColorBrush x:Key="ScrollWhiteVerticalPressedOutterBackgroundBrush" Color="#FFD6D7D9" />
  <LinearGradientBrush x:Key="ScrollWhiteVerticalPressedInnerBorderBrush" EndPoint="1,0.5" StartPoint="0,0.5">
    <GradientStop Color="#FFE1E2E3" Offset="0" />
    <GradientStop Color="#FFE1E2E3" Offset="1" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="ScrollWhiteVerticalPressedInnerBackgroundBrush" EndPoint="1,0.5" StartPoint="0,0.5">
    <GradientStop Color="#FFE1E2E3" Offset="0" />
    <GradientStop Color="#FFE1E2E3" Offset="1" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="ScrollWhiteVerticalBackgroundBrush" EndPoint="1,0.5" StartPoint="0,0.5">
    <GradientStop Color="#FFE1E2E3" Offset="0" />
    <GradientStop Color="#FFEFEFEF" Offset="0.05" />
    <GradientStop Color="#FFEFEFEF" Offset="0.95" />
    <GradientStop Color="#FFEBEDEF" Offset="1" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="ButtonBackstageOutterBorderBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FFDEDFE0" Offset="0" />
    <GradientStop Color="#FFA1A2A4" Offset="1" />
  </LinearGradientBrush>
  <SolidColorBrush x:Key="ButtonBackstageShadowBrush" Color="#7FA1A2A4" />
  <LinearGradientBrush x:Key="ButtonBackstageInnerBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="White" Offset="0.009" />
    <GradientStop Color="#FFEDEFF1" Offset="1" />
  </LinearGradientBrush>
  <ControlTemplate x:Key="ControlFocusEmptyTemplate" TargetType="{x:Type Control}">
    <Rectangle Stroke="#00000000">
      <Rectangle.Fill>
        <SolidColorBrush />
      </Rectangle.Fill>
    </Rectangle>
  </ControlTemplate>
  <Fluent:ObjectToImageConverter x:Key="StringToImageConvert" />
  <Fluent:ApplicationMenuRightContentExtractorConverter x:Key="ApplicationMenuRightContentExtractorConvert" />
  <ControlTemplate x:Key="BackstageToggleButtonControlTemplate" TargetType="{x:Type Fluent:Backstage}">
    <Border x:Name="border2" MinWidth="56" Height="24" CornerRadius="2,2,0,0" Background="{TemplateBinding Background}" Margin="0,0,0,1">
      <Border x:Name="border1" BorderThickness="1,1,1,0" CornerRadius="2,2,0,0">
        <Border.BorderBrush>
          <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#997C7C7C" Offset="0" />
            <GradientStop Color="#7F848484" Offset="1" />
          </LinearGradientBrush>
        </Border.BorderBrush>
        <Border x:Name="border" BorderThickness="1,1,1,0" CornerRadius="1,1,0,0">
          <Border.BorderBrush>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
              <GradientStop Color="#72FFFFFF" Offset="0" />
              <GradientStop Color="#4CFFFFFF" Offset="1" />
            </LinearGradientBrush>
          </Border.BorderBrush>
          <Border.Background>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
              <GradientStop Color="#3FFFFFFF" Offset="0" />
              <GradientStop Offset="1" Color="#3FFFFFFF" />
              <GradientStop Offset="0.5" />
            </LinearGradientBrush>
          </Border.Background>
          <Grid>
            <Rectangle x:Name="rectangle_Copy" StrokeThickness="0">
              <Rectangle.Fill>
                <RadialGradientBrush Center="0.5,0.0" GradientOrigin="0.5,0.0" RadiusX="0.501" RadiusY="0.319">
                  <GradientStop Color="#59FFFFFF" />
                  <GradientStop Offset="1" />
                </RadialGradientBrush>
              </Rectangle.Fill>
            </Rectangle>
            <Rectangle x:Name="rectangle" StrokeThickness="0">
              <Rectangle.Fill>
                <RadialGradientBrush Center="0.5,1.001" GradientOrigin="0.5,1.001" RadiusX="0.496" RadiusY="0.554">
                  <GradientStop Color="#66FFFFFF" Offset="0.018" />
                  <GradientStop Offset="1" />
                </RadialGradientBrush>
              </Rectangle.Fill>
            </Rectangle>
            <!--<TextBlock Margin="2,0,2,2" Text="{TemplateBinding Header}" TextWrapping="Wrap" d:LayoutOverrides="Width, Height" HorizontalAlignment="Center" VerticalAlignment="Center"/>-->
            <ContentPresenter x:Name="contentPresenter" ContentSource="Header" VerticalAlignment="Center" HorizontalAlignment="Center" />
          </Grid>
        </Border>
      </Border>
    </Border>
    <ControlTemplate.Triggers>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsMouseOver" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="BorderBrush" TargetName="border1">
          <Setter.Value>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
              <GradientStop Color="#A07C7C7C" Offset="0" />
              <GradientStop Color="#84848484" Offset="1" />
            </LinearGradientBrush>
          </Setter.Value>
        </Setter>
        <Setter Property="Background" TargetName="border">
          <Setter.Value>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
              <GradientStop Color="#4CFFFFFF" Offset="0" />
              <GradientStop Color="#25FFFFFF" Offset="1" />
              <GradientStop Offset="0.5" Color="#19FFFFFF" />
            </LinearGradientBrush>
          </Setter.Value>
        </Setter>
        <Setter Property="BorderBrush" TargetName="border">
          <Setter.Value>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
              <GradientStop Color="#7FFFFFFF" Offset="0" />
              <GradientStop Color="#59FFFFFF" Offset="1" />
            </LinearGradientBrush>
          </Setter.Value>
        </Setter>
        <Setter Property="Fill" TargetName="rectangle_Copy">
          <Setter.Value>
            <RadialGradientBrush Center="0.5,0" GradientOrigin="0.5,0" RadiusX="0.501" RadiusY="0.319">
              <GradientStop Color="#66FFFFFF" />
              <GradientStop Offset="1" />
            </RadialGradientBrush>
          </Setter.Value>
        </Setter>
        <Setter Property="Fill" TargetName="rectangle">
          <Setter.Value>
            <RadialGradientBrush Center="0.5,1.001" GradientOrigin="0.5,1.001" RadiusX="0.496" RadiusY="0.554">
              <GradientStop Color="#7FFFFFFF" Offset="0.018" />
              <GradientStop Offset="1" />
            </RadialGradientBrush>
          </Setter.Value>
        </Setter>
      </MultiTrigger>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="Opacity" TargetName="border2" Value="0.5" />
        <Setter Property="Effect" TargetName="contentPresenter">
          <Setter.Value>
            <Fluent:GrayscaleEffect />
          </Setter.Value>
        </Setter>
      </Trigger>
      <Trigger Property="IsOpen" Value="True">
        <Setter Property="Margin" TargetName="border2" Value="0" />
        <Setter Property="Visibility" TargetName="rectangle" Value="Collapsed" />
        <Setter Property="Visibility" TargetName="rectangle_Copy" Value="Collapsed" />
        <Setter Property="BorderBrush" TargetName="border1">
          <Setter.Value>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
              <GradientStop Color="#99959595" Offset="0" />
              <GradientStop Color="#7F909090" Offset="1" />
            </LinearGradientBrush>
          </Setter.Value>
        </Setter>
        <Setter Property="BorderBrush" TargetName="border">
          <Setter.Value>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
              <GradientStop Color="#4CFFFFFF" Offset="0" />
              <GradientStop Color="#72FFFFFF" Offset="1" />
            </LinearGradientBrush>
          </Setter.Value>
        </Setter>
        <Setter Property="Background" TargetName="border">
          <Setter.Value>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
              <GradientStop Color="#19FFFFFF" Offset="0" />
              <GradientStop Color="#66FFFFFF" Offset="1" />
              <GradientStop Offset="0.5" Color="#3FFFFFFF" />
            </LinearGradientBrush>
          </Setter.Value>
        </Setter>
      </Trigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsMouseOver" Value="True" SourceName="border2" />
          <Condition Property="IsOpen" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="Visibility" TargetName="rectangle" Value="Collapsed" />
        <Setter Property="Visibility" TargetName="rectangle_Copy" Value="Collapsed" />
        <Setter Property="BorderBrush" TargetName="border1">
          <Setter.Value>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
              <GradientStop Color="#A0A1A1A1" Offset="0" />
              <GradientStop Color="#879A9A9A" Offset="1" />
            </LinearGradientBrush>
          </Setter.Value>
        </Setter>
        <Setter Property="BorderBrush" TargetName="border">
          <Setter.Value>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
              <GradientStop Color="#59FFFFFF" Offset="0" />
              <GradientStop Color="#7FFFFFFF" Offset="1" />
            </LinearGradientBrush>
          </Setter.Value>
        </Setter>
        <Setter Property="Background" TargetName="border">
          <Setter.Value>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
              <GradientStop Color="#26FFFFFF" Offset="0" />
              <GradientStop Color="#7FFFFFFF" Offset="1" />
              <GradientStop Offset="0.5" Color="#4CFFFFFF" />
            </LinearGradientBrush>
          </Setter.Value>
        </Setter>
      </MultiTrigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <BooleanToVisibilityConverter x:Key="boolToVisibilityConverter" />
  <MenuScrollingVisibilityConverter x:Key="MenuScrollingVisibilityConverter" />
  <ControlTemplate x:Key="TwoLineLabelControlTemplate" TargetType="{x:Type Fluent:TwoLineLabel}">
    <StackPanel x:Name="stackPanel" Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Center">
      <AccessText TextWrapping="Wrap" x:Name="PART_TextRun" TextAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center" />
      <StackPanel x:Name="stackPanel1" Margin="0" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
        <AccessText TextWrapping="Wrap" x:Name="PART_TextRun2" TextAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center" />
        <Border x:Name="border" Height="Auto" Width="5" HorizontalAlignment="Center" Margin="0">
          <Path x:Name="path" Width="5" Height="3" StrokeThickness="0" Data="M0,0L5,0 2.5,3z" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,2,0,0" SnapsToDevicePixels="True" Fill="{TemplateBinding Foreground}" />
        </Border>
      </StackPanel>
    </StackPanel>
    <ControlTemplate.Triggers>
      <Trigger Property="HasTwoLines" Value="False">
        <Setter Property="Orientation" TargetName="stackPanel" Value="Horizontal" />
        <Setter Property="HorizontalAlignment" TargetName="stackPanel" Value="Left" />
        <Setter Property="Margin" TargetName="border" Value="0" />
        <Setter Property="VerticalAlignment" TargetName="stackPanel" Value="Center" />
        <Setter Property="VerticalAlignment" TargetName="border" Value="Center" />
        <Setter Property="Margin" TargetName="stackPanel1" Value="3,0,0,0" />
        <Setter Property="VerticalAlignment" TargetName="stackPanel1" Value="Center" />
      </Trigger>
      <Trigger Property="HasGlyph" Value="False">
        <Setter Property="Visibility" TargetName="path" Value="Collapsed" />
        <Setter Property="Width" TargetName="border" Value="0.1" />
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <Style x:Key="EmptyCheckBoxFocusVisual">
    <Setter Property="Control.Template">
      <Setter.Value>
        <ControlTemplate>
          <Rectangle Margin="1" SnapsToDevicePixels="true" Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" />
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="CheckRadioFocusVisual">
    <Setter Property="Control.Template">
      <Setter.Value>
        <ControlTemplate>
          <Rectangle Margin="14,0,0,0" SnapsToDevicePixels="true" Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" />
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="EmptyRadioButtonFocusVisual">
    <Setter Property="Control.Template">
      <Setter.Value>
        <ControlTemplate>
          <Rectangle Margin="1" SnapsToDevicePixels="true" Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" />
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <ControlTemplate x:Key="GalleryGroupContainerTemplate" TargetType="{x:Type Fluent:GalleryGroupContainer}">
    <!--<Border BorderThickness="1" BorderBrush="DarkGray" Margin="1">
      <StackPanel>
        <Border BorderThickness="1" BorderBrush="DarkGray" Margin="1">
          <TextBlock Text="{TemplateBinding Header}" />
        </Border>
        <WrapPanel HorizontalAlignment="Left"
                   IsItemsHost="True" Orientation="{TemplateBinding Orientation}"
                   ItemWidth ="{TemplateBinding ItemWidth}"
                   ItemHeight="{TemplateBinding ItemHeight}"/>
      </StackPanel>
    </Border>-->
    <Grid>
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="Auto" />
        <ColumnDefinition Width="*" />
      </Grid.ColumnDefinitions>
      <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
        <RowDefinition />
      </Grid.RowDefinitions>
      <Grid Grid.Row="0" Height="21" x:Name="headerGrid" Background="#FFF0F2F5" Grid.ColumnSpan="2" VerticalAlignment="Top">
        <TextBlock Margin="7,0" Text="{TemplateBinding Header}" VerticalAlignment="Center" HorizontalAlignment="Left" FontWeight="Bold" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" />
      </Grid>
      <Image Grid.Row="1" Grid.Column="0" Stretch="None" Margin="4,0,4,0" VerticalAlignment="Top" HorizontalAlignment="Center" x:Name="iconImage">
        <!--        <Image.Source>
          <MultiBinding Converter="{StaticResource GroupIconConverter}">
            <Binding Path="Items"/>
            <Binding ElementName="layoutRoot"/>
          </MultiBinding>
        </Image.Source>-->
      </Image>
      <Rectangle Grid.Row="1" Fill="{x:Null}" Stretch="Fill" Stroke="#FFE2E4E7" HorizontalAlignment="Right" Width="1" Height="Auto" Visibility="Visible" x:Name="menuLine" Margin="0,0,0,0" />
      <ItemsPresenter Grid.Row="1" Grid.Column="1" Margin="0,0,0,0" />
      <!--<WrapPanel Grid.Column="1" Margin="0,21,0,0"
                   IsItemsHost="True" Orientation="{TemplateBinding Orientation}"
                   ItemWidth ="{TemplateBinding ItemWidth}"
                   ItemHeight="{TemplateBinding ItemHeight}"/>-->
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger SourceName="iconImage" Property="Source" Value="{x:Null}">
        <Setter TargetName="menuLine" Property="Visibility" Value="Collapsed" />
        <Setter TargetName="iconImage" Property="Visibility" Value="Collapsed" />
      </Trigger>
      <Trigger Property="IsHeadered" Value="False">
        <Setter TargetName="headerGrid" Property="Visibility" Value="Collapsed" />
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <ControlTemplate x:Key="RibbonTitleBarControlTemplate" TargetType="{x:Type Fluent:RibbonTitleBar}">
    <Grid Height="25">
      <ContentPresenter x:Name="PART_QuickAccessToolbarHolder" ContentSource="QuickAccessToolBar" />
      <ContentPresenter x:Name="PART_HeaderHolder" ContentSource="Header" IsHitTestVisible="False" />
      <Fluent:RibbonContextualGroupsContainer x:Name="PART_ItemsContainer" IsItemsHost="True" />
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="IsCollapsed" Value="True">
        <Setter Property="Visibility" Value="Collapsed" TargetName="PART_QuickAccessToolbarHolder" />
        <Setter Property="Visibility" Value="Collapsed" TargetName="PART_ItemsContainer" />
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <ControlTemplate x:Key="ResizeBothThumbControlTemplate" TargetType="{x:Type Thumb}">
    <Grid Background="#00000000">
      <Rectangle Fill="White" StrokeThickness="0" Width="2" Height="2" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="0,0,2,1" />
      <Rectangle Fill="White" StrokeThickness="0" HorizontalAlignment="Right" Margin="0,0,2,5" VerticalAlignment="Bottom" Width="2" Height="2" />
      <Rectangle Fill="White" StrokeThickness="0" HorizontalAlignment="Right" Margin="0,0,6,1" VerticalAlignment="Bottom" Width="2" Height="2" />
      <Rectangle Fill="#FFB5BEC7" StrokeThickness="0" HorizontalAlignment="Right" Margin="0,0,3,2" VerticalAlignment="Bottom" Width="2" Height="2" />
      <Rectangle Fill="#FFB5BEC7" StrokeThickness="0" HorizontalAlignment="Right" Margin="0,0,3,6" VerticalAlignment="Bottom" Width="2" Height="2" />
      <Rectangle Fill="#FFB5BEC7" StrokeThickness="0" HorizontalAlignment="Right" Margin="0,0,7,2" VerticalAlignment="Bottom" Width="2" Height="2" />
    </Grid>
  </ControlTemplate>
  <ControlTemplate x:Key="ResizeVerticalThumbControlTemplate" TargetType="{x:Type Thumb}">
    <Grid Background="#00000000">
      <StackPanel Margin="0,1,0,0" Orientation="Horizontal" d:LayoutOverrides="Height" HorizontalAlignment="Center" VerticalAlignment="Center">
        <Grid HorizontalAlignment="Left" Margin="1,0,0,0" Width="Auto" Height="Auto">
          <Rectangle Fill="White" StrokeThickness="0" HorizontalAlignment="Center" Margin="0" VerticalAlignment="Center" Width="2" Height="2" />
          <Rectangle Fill="#FFB5BEC7" StrokeThickness="0" HorizontalAlignment="Center" Margin="0,0,1,1" VerticalAlignment="Center" Width="2" Height="2" />
        </Grid>
        <Grid HorizontalAlignment="Left" Margin="1,0,0,0" Width="Auto" Height="Auto">
          <Rectangle Fill="White" StrokeThickness="0" HorizontalAlignment="Center" Margin="0" VerticalAlignment="Center" Width="2" Height="2" />
          <Rectangle Fill="#FFB5BEC7" StrokeThickness="0" HorizontalAlignment="Center" Margin="0,0,1,1" VerticalAlignment="Center" Width="2" Height="2" />
        </Grid>
        <Grid HorizontalAlignment="Left" Margin="1,0,0,0" Width="Auto" Height="Auto">
          <Rectangle Fill="White" StrokeThickness="0" HorizontalAlignment="Center" Margin="0" VerticalAlignment="Center" Width="2" Height="2" />
          <Rectangle Fill="#FFB5BEC7" StrokeThickness="0" HorizontalAlignment="Center" Margin="0,0,1,1" VerticalAlignment="Center" Width="2" Height="2" />
        </Grid>
        <Grid HorizontalAlignment="Left" Margin="1,0,0,0" Width="Auto" Height="Auto">
          <Rectangle Fill="White" StrokeThickness="0" HorizontalAlignment="Center" Margin="0" VerticalAlignment="Center" Width="2" Height="2" />
          <Rectangle Fill="#FFB5BEC7" StrokeThickness="0" HorizontalAlignment="Center" Margin="0,0,1,1" VerticalAlignment="Center" Width="2" Height="2" />
        </Grid>
      </StackPanel>
    </Grid>
  </ControlTemplate>
  <ControlTemplate x:Key="MenuGroupSeparatorControlTemplate" TargetType="{x:Type Fluent:GroupSeparatorMenuItem}">
    <Grid Height="21" Background="#FFF0F2F5">
      <TextBlock Margin="7,0" Text="{TemplateBinding Header}" TextWrapping="Wrap" d:LayoutOverrides="Width, Height" VerticalAlignment="Center" HorizontalAlignment="Left" FontWeight="Bold" />
    </Grid>
  </ControlTemplate>
  <ControlTemplate x:Key="BackstageButtonControlTemplate" TargetType="{x:Type Fluent:Button}">
    <Grid Background="#00000000">
      <Border x:Name="border" BorderBrush="{x:Null}" BorderThickness="0" CornerRadius="1" Visibility="Collapsed" Background="{TemplateBinding Background}">
        <Border Margin="0" CornerRadius="1" BorderThickness="1" BorderBrush="#19000000" Background="#BFFFFFFF">
          <Border BorderBrush="#7FFFFFFF" BorderThickness="1" CornerRadius="1" Background="#33FFFFFF" />
        </Border>
      </Border>
      <StackPanel Orientation="Horizontal" Margin="16,0,15,0" HorizontalAlignment="Left" VerticalAlignment="Center">
        <ContentPresenter x:Name="iconImage" HorizontalAlignment="Left" Height="16" VerticalAlignment="Center" Content="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource StringToImageConvert}}" Width="16" SnapsToDevicePixels="True" />
        <TextBlock Text="{TemplateBinding Header}" TextWrapping="NoWrap" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5,0,0,0" TextTrimming="CharacterEllipsis" x:Name="controlLabel" />
      </StackPanel>
    </Grid>
    <ControlTemplate.Triggers>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsMouseOver" Value="True" />
          <Condition Property="IsEnabled" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="Visibility" TargetName="border" Value="Visible" />
      </MultiTrigger>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="Opacity" TargetName="iconImage" Value="0.5" />
        <Setter Property="Opacity" TargetName="controlLabel" Value="0.5" />
        <Setter Property="Effect" TargetName="iconImage">
          <Setter.Value>
            <Fluent:GrayscaleEffect />
          </Setter.Value>
        </Setter>
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <Style x:Key="{x:Type StatusBarItem}" TargetType="{x:Type StatusBarItem}">
    <Setter Property="Padding" Value="3,0,3,0" />
    <Setter Property="OverridesDefaultStyle" Value="True" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type StatusBarItem}">
          <ContentPresenter Margin="{TemplateBinding Padding}" />
          <ControlTemplate.Triggers>
            <Trigger Property="IsEnabled" Value="false">
              <Setter Property="Foreground" Value="#FF888888" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="ScrollBarPageButton" TargetType="{x:Type RepeatButton}">
    <Setter Property="SnapsToDevicePixels" Value="True" />
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="IsTabStop" Value="false" />
    <Setter Property="Focusable" Value="false" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type RepeatButton}">
          <Border Background="Transparent" />
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="ScrollBarWhitePageButton" TargetType="{x:Type RepeatButton}">
    <Setter Property="SnapsToDevicePixels" Value="True" />
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="IsTabStop" Value="false" />
    <Setter Property="Focusable" Value="false" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type RepeatButton}">
          <Border Background="Transparent" />
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <ControlTemplate x:Key="TextBoxControlTemplate" TargetType="{x:Type Fluent:TextBox}">
    <Border Name="Border" CornerRadius="0" Padding="{TemplateBinding Padding}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
      <ScrollViewer Margin="0" x:Name="PART_ContentHost" />
    </Border>
  </ControlTemplate>
  <Fluent:ColorGradientItemTemplateSelector x:Key="ColorGradientItemTemplateSelect" />
  <Style x:Key="SeparatorTabItemStyle" TargetType="Fluent:SeparatorTabItem">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="Fluent:SeparatorTabItem">
          <ContentPresenter ContentSource="Header" />
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="RibbonStatusBarItemStyle" TargetType="{x:Type Fluent:StatusBarItem}">
    <Setter Property="Padding" Value="3,0,3,0" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Fluent:StatusBarItem}">
          <ContentPresenter Margin="{TemplateBinding Padding}" />
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Style.Triggers>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="Foreground" Value="#FF888888" />
      </Trigger>
    </Style.Triggers>
  </Style>
  <Style x:Key="SliderButtonStyle" TargetType="{x:Type RepeatButton}">
    <Setter Property="SnapsToDevicePixels" Value="true" />
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="IsTabStop" Value="false" />
    <Setter Property="Focusable" Value="false" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type RepeatButton}">
          <Border Background="Transparent" />
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Fluent:IconConverter x:Key="IconConvert" />
  <BitmapImage x:Key="ImageCaptionButtonClose" UriSource="pack://application:,,,/Fluent;component/Themes/Office2010/Images/CaptionButtonClose.png" PresentationOptions:Freeze="True" />
  <BitmapImage x:Key="ImageCaptionButtonMinimize" UriSource="pack://application:,,,/Fluent;component/Themes/Office2010/Images/CaptionButtonMinimize.png" PresentationOptions:Freeze="True" />
  <BitmapImage x:Key="ImageCaptionButtonNormalize" UriSource="pack://application:,,,/Fluent;component/Themes/Office2010/Images/CaptionButtonNormalize.png" PresentationOptions:Freeze="True" />
  <BitmapImage x:Key="ImageCaptionButtonMaximize" UriSource="pack://application:,,,/Fluent;component/Themes/Office2010/Images/CaptionButtonMaximize.png" PresentationOptions:Freeze="True" />
  <Style x:Key="ControlStyleEmptyFocus" TargetType="{x:Type Control}">
    <Setter Property="Template" Value="{StaticResource ControlFocusEmptyTemplate}" />
  </Style>
  <Style x:Key="RibbonBackstageStyle" TargetType="{x:Type Fluent:Backstage}">
    <Setter Property="Template" Value="{StaticResource BackstageToggleButtonControlTemplate}" />
    <Setter Property="Background" Value="Blue" />
    <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}" />
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
    <Setter Property="Foreground" Value="White" />
    <Setter Property="SnapsToDevicePixels" Value="True" />
    <Setter Property="Fluent:FrameworkHelper.UseLayoutRounding" Value="True" />
  </Style>
  <Style TargetType="{x:Type Fluent:Backstage}" BasedOn="{StaticResource RibbonBackstageStyle}" />
  <ControlTemplate x:Key="RibbonTabControlToggleButtonControlTemplate" TargetType="{x:Type Fluent:ToggleButton}">
    <Border x:Name="border" BorderThickness="1" CornerRadius="2" Background="{StaticResource TransparentBrush}" BorderBrush="{StaticResource TransparentBrush}" Height="22" HorizontalAlignment="Left" VerticalAlignment="Stretch" Width="22">
      <Border.ToolTip>
        <Fluent:ScreenTip x:Name="screenTip" Title="{Binding Source={x:Static Fluent:Ribbon.Localization}, Path=MinimizeButtonScreenTipTitle , Mode=OneWay}" Text="{Binding Source={x:Static Fluent:Ribbon.Localization}, Path=MinimizeButtonScreenTipText , Mode=OneWay}" />
      </Border.ToolTip>
      <Border x:Name="border1" Height="Auto" BorderBrush="{StaticResource TransparentBrush}" BorderThickness="1" CornerRadius="2" Background="{StaticResource TransparentBrush}">
        <Grid>
          <Image x:Name="iconImage" HorizontalAlignment="Center" Height="Auto" Stretch="None" VerticalAlignment="Center" Source="/Fluent;Component/Themes/Office2010/Images/RibbonCollapse.png" Width="Auto" Margin="2" />
          <Image x:Name="iconImageChecked" Visibility="Collapsed" HorizontalAlignment="Center" Height="Auto" Stretch="None" VerticalAlignment="Center" Source="/Fluent;Component/Themes/Office2010/Images/RibbonExpand.png" Width="Auto" Margin="2" />
        </Grid>
      </Border>
    </Border>
    <ControlTemplate.Triggers>
      <Trigger Property="IsChecked" Value="True">
        <Setter Property="Visibility" TargetName="iconImage" Value="Collapsed" />
        <Setter Property="Visibility" TargetName="iconImageChecked" Value="Visible" />
        <Setter Property="Title" TargetName="screenTip" Value="{Binding Source={x:Static Fluent:Ribbon.Localization}, Path=ExpandButtonScreenTipTitle , Mode=OneWay}" />
        <Setter Property="Text" TargetName="screenTip" Value="{Binding Source={x:Static Fluent:Ribbon.Localization}, Path=ExpandButtonScreenTipText , Mode=OneWay}" />
      </Trigger>
      <Trigger Property="IsPressed" Value="True">
        <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonPressedOuterBorderBrush}" />
        <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonPressedOuterBackgroundBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonPressedInnerBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonPressedInnerBorderBrush}" />
      </Trigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsMouseOver" Value="True" />
          <Condition Property="IsPressed" Value="False" />
        </MultiTrigger.Conditions>
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
        <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsKeyboardFocusWithin" Value="True" />
          <Condition Property="IsPressed" Value="False" />
        </MultiTrigger.Conditions>
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
        <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
      </MultiTrigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <Style x:Key="RibbonTabControlToggleButtonStyle" TargetType="{x:Type Fluent:ToggleButton}">
    <Setter Property="Template" Value="{StaticResource RibbonTabControlToggleButtonControlTemplate}" />
    <Setter Property="Height" Value="22" />
    <Setter Property="Width" Value="22" />
    <!--<Setter Property="QuickAccessElementStyle">
        <Setter.Value>
            <Style TargetType="{x:Type Fluent:ToggleButton}">
                <Setter Property="Template" Value="{StaticResource RibbonTabControlToggleButtonControlTemplate}"/>
                <Setter Property="Height" Value="22"/>
                <Setter Property="Width" Value="22"/>			
                <Setter Property="FontSize" Value="{DynamicResource DefaultFontSize}"/>
                <Setter Property="FontFamily" Value="{DynamicResource DefaultFontFamily}"/>
                <Setter Property="Foreground" Value="{DynamicResource DefaultFontBrush}"/>
                <Setter Property="FocusVisualStyle" Value="{DynamicResource ControlStyleEmptyFocus}"/>
            </Style>
        </Setter.Value>
    </Setter>-->
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
    <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}" />
    <Setter Property="Foreground" Value="{StaticResource DefaultFontBrush}" />
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlStyleEmptyFocus}" />
  </Style>
  <Style x:Key="RibbonTabItemStyle" TargetType="{x:Type Fluent:RibbonTabItem}">
    <Style.Triggers>
      <Trigger Property="Group" Value="{x:Null}">
        <Setter Property="BorderBrush" Value="{StaticResource RibbonTopBorderBrush}" />
      </Trigger>
      <Trigger Property="Selector.IsSelected" Value="False">
        <Setter Property="Foreground" Value="{StaticResource TabItemFontBrush}" />
      </Trigger>
    </Style.Triggers>
    <Setter Property="HorizontalAlignment" Value="Left" />
    <Setter Property="VerticalAlignment" Value="Top" />
    <Setter Property="Height" Value="31" />
    <Setter Property="IsMinimized" Value="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:RibbonTabControl}}, Path=IsMinimized, Mode=OneWay, FallbackValue=False}" />
    <Setter Property="IsOpen" Value="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:RibbonTabControl}}, Path=IsDropDownOpen, Mode=OneWay, FallbackValue=True}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Fluent:RibbonTabItem}">
          <Grid x:Name="grid" Background="#00000000" Height="24" VerticalAlignment="Top" Margin="0,7,0,0">
            <Border x:Name="border3" Margin="2,0,0,1" BorderThickness="1,0" Grid.ColumnSpan="2">
              <Border.BorderBrush>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                  <GradientStop Color="#CCFFFFFF" Offset="0" />
                  <GradientStop Offset="1" Color="#7FFFFFFF" />
                </LinearGradientBrush>
              </Border.BorderBrush>
              <Border x:Name="border4" BorderBrush="{Binding Group.BorderBrush, RelativeSource={RelativeSource TemplatedParent}}" BorderThickness="1,0">
                <Border.OpacityMask>
                  <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="Black" Offset="0" />
                    <GradientStop Color="#00000000" Offset="0.981" />
                  </LinearGradientBrush>
                </Border.OpacityMask>
                <Border Background="{Binding Group.Background, RelativeSource={RelativeSource TemplatedParent}}" BorderThickness="0" Margin="0">
                  <Border.OpacityMask>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                      <GradientStop Color="#59000000" Offset="0" />
                      <GradientStop Color="#00000000" Offset="1" />
                    </LinearGradientBrush>
                  </Border.OpacityMask>
                  <Rectangle x:Name="rectangle4" Fill="#3FD2D2D2" StrokeThickness="0">
                    <Rectangle.OpacityMask>
                      <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#7F000000" Offset="0" />
                        <GradientStop Color="#00000000" Offset="1" />
                      </LinearGradientBrush>
                    </Rectangle.OpacityMask>
                  </Rectangle>
                </Border>
              </Border>
            </Border>
            <Grid x:Name="selectedGrid" Visibility="Collapsed" Margin="2,0,0,0" Grid.ColumnSpan="1">
              <Rectangle x:Name="rectangle" Fill="{StaticResource ActiveTabBackgroundBrush}" Stroke="{x:Null}" StrokeThickness="0" Margin="0" VerticalAlignment="Bottom" Height="1" />
              <Rectangle x:Name="rectangle1" Fill="{StaticResource ActiveTabBackgroundBrush}" Stroke="{x:Null}" StrokeThickness="0" Margin="1.8,0" VerticalAlignment="Bottom" Height="1.2" />
              <Rectangle x:Name="rectangle2" Fill="{StaticResource ActiveTabBackgroundBrush}" Stroke="{x:Null}" StrokeThickness="0" Margin="2,0" VerticalAlignment="Bottom" Height="2" />
              <Border x:Name="border" Margin="1,0,1,2" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,1,1,0" VerticalAlignment="Stretch" CornerRadius="2,2,0,0" Background="{StaticResource ActiveTabBackgroundBrush}">
                <Border x:Name="border_Copy3" Margin="0" BorderThickness="1,1,1,0" VerticalAlignment="Stretch" CornerRadius="2,2,0,0" Background="{x:Null}" BorderBrush="{StaticResource ActiveTabBackgroundBrush}">
                  <Border x:Name="border_Copy4" Margin="0,0,-2,-1" BorderThickness="0" VerticalAlignment="Stretch" CornerRadius="2,2,0,0" Background="{Binding Group.Background, RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{x:Null}">
                    <Border.OpacityMask>
                      <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#3F000000" Offset="0" />
                        <GradientStop Color="#00000000" Offset="0.59" />
                      </LinearGradientBrush>
                    </Border.OpacityMask>
                  </Border>
                </Border>
              </Border>
              <Border x:Name="border1" HorizontalAlignment="Left" Margin="0" VerticalAlignment="Bottom" Width="2" Height="2" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0,0,1,1" CornerRadius="0,0,2,0" />
              <Border x:Name="border2" HorizontalAlignment="Right" Margin="0" VerticalAlignment="Bottom" Width="2" Height="2" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,0,0,1" CornerRadius="0,0,0,2" />
              <Rectangle x:Name="rectangle3" StrokeThickness="0" Margin="7,-7,7,0" VerticalAlignment="Top" Height="14" IsHitTestVisible="False">
                <Rectangle.Fill>
                  <RadialGradientBrush Center="0.498,0.501" GradientOrigin="0.498,0.501" RadiusY="0.464">
                    <GradientStop Color="#7FFFFFFF" Offset="0" />
                    <GradientStop Offset="1" />
                  </RadialGradientBrush>
                </Rectangle.Fill>
              </Rectangle>
            </Grid>
            <Grid x:Name="hoverGrid" Margin="2,0,0,0" Visibility="Collapsed" Grid.ColumnSpan="1">
              <Border x:Name="border_Copy" Margin="1,0,1,1" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,1,1,0" VerticalAlignment="Stretch" CornerRadius="2,2,0,0" Background="{x:Null}">
                <Border.OpacityMask>
                  <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#CC000000" Offset="0" />
                    <GradientStop Color="#F7FFFFFF" Offset="0.985" />
                  </LinearGradientBrush>
                </Border.OpacityMask>
                <Border x:Name="border_Copy1" Margin="0" BorderBrush="{StaticResource ActiveTabBackgroundBrush}" BorderThickness="1,1,1,0" VerticalAlignment="Stretch" CornerRadius="2,2,0,0" Background="{x:Null}">
                  <Border.OpacityMask>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                      <GradientStop Color="#CCFFFFFF" Offset="0" />
                      <GradientStop Color="#F7FFFFFF" Offset="1" />
                    </LinearGradientBrush>
                  </Border.OpacityMask>
                  <Border x:Name="border_Copy2" Margin="0" BorderBrush="{x:Null}" BorderThickness="0" VerticalAlignment="Stretch" CornerRadius="2,2,0,0" Background="{StaticResource ActiveTabBackgroundBrush}">
                    <Border.OpacityMask>
                      <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#7FFFFFFF" Offset="0.004" />
                        <GradientStop Offset="0.5" />
                      </LinearGradientBrush>
                    </Border.OpacityMask>
                  </Border>
                </Border>
              </Border>
            </Grid>
            <Grid x:Name="focusedGrid" Margin="2,0,0,0" Visibility="Collapsed" Grid.ColumnSpan="1">
              <Grid.OpacityMask>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                  <GradientStop Color="White" Offset="0" />
                  <GradientStop Offset="1" Color="#19FFFFFF" />
                </LinearGradientBrush>
              </Grid.OpacityMask>
              <Border x:Name="border_Copy5" Margin="1,0,1,1" BorderThickness="1,1,1,0" VerticalAlignment="Stretch" CornerRadius="2,2,0,0" Background="{StaticResource ButtonHoverOuterBackgroundBrush}" BorderBrush="{StaticResource ButtonHoverOuterBorderBrush}">
                <Border x:Name="border_Copy6" Margin="0" BorderBrush="{StaticResource ButtonHoverInnerBorderBrush}" BorderThickness="1,1,1,0" VerticalAlignment="Stretch" CornerRadius="2,2,0,0" Background="{StaticResource ButtonHoverInnerBackgroundBrush}" />
              </Border>
            </Grid>
            <Border x:Name="PART_ContentContainer" HorizontalAlignment="Stretch" Margin="6,2,4,0" VerticalAlignment="Stretch" Padding="15,0,0,0" Grid.ColumnSpan="1">
              <!--<ContentPresenter x:Name="contentPresenter" ContentSource="Header" HorizontalAlignment="Center" VerticalAlignment="Center" Height="Auto"/>-->
              <Label x:Name="contentPresenter" AutomationProperties.Name="{TemplateBinding Header}" AutomationProperties.AutomationId="{TemplateBinding Name}" Content="{TemplateBinding Header}" Margin="0, -3, 0,0" HorizontalAlignment="Center" VerticalAlignment="Center" Height="Auto" />
            </Border>
            <Grid x:Name="separatorGrid" Margin="0" Visibility="Collapsed" HorizontalAlignment="Right" Width="2" Grid.Column="1">
              <Rectangle x:Name="separatorRectangle1" Fill="{StaticResource RibbonTopBorderBrush}" Stroke="{StaticResource RibbonTopBorderBrush}" Margin="0,0,1,0" HorizontalAlignment="Right" Width="1" Opacity="1" Visibility="Visible">
                <Rectangle.OpacityMask>
                  <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#00000000" Offset="0" />
                    <GradientStop Color="#E5FFFFFF" Offset="0.382" />
                  </LinearGradientBrush>
                </Rectangle.OpacityMask>
              </Rectangle>
              <Rectangle x:Name="separatorRectangle2" Fill="{StaticResource ActiveTabBackgroundBrush}" Stroke="{StaticResource ActiveTabBackgroundBrush}" HorizontalAlignment="Right" Margin="0" Width="1" Opacity="1" Visibility="Visible">
                <Rectangle.OpacityMask>
                  <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#00000000" Offset="0" />
                    <GradientStop Color="#BFFFFFFF" Offset="0.329" />
                  </LinearGradientBrush>
                </Rectangle.OpacityMask>
              </Rectangle>
            </Grid>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsEnabled" Value="False">
              <Setter Property="Opacity" TargetName="contentPresenter" Value="0.5" />
            </Trigger>
            <!--<Trigger Property="IsKeyboardFocused" Value="True">
              <Setter Property="Visibility" TargetName="focusedGrid" Value="Visible"/>
            </Trigger>-->
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="HasRightGroupBorder" Value="False" />
                <Condition Property="HasLeftGroupBorder" Value="True" />
              </MultiTrigger.Conditions>
              <Setter Property="BorderThickness" TargetName="border3" Value="1,0,0,0" />
              <Setter Property="BorderThickness" TargetName="border4" Value="1,0,0,0" />
              <Setter Property="Margin" TargetName="rectangle4" Value="0" />
            </MultiTrigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="HasLeftGroupBorder" Value="False" />
                <Condition Property="HasRightGroupBorder" Value="True" />
              </MultiTrigger.Conditions>
              <Setter Property="BorderThickness" TargetName="border4" Value="0,0,1,0" />
              <Setter Property="BorderThickness" TargetName="border3" Value="0,0,1,0" />
              <Setter Property="Margin" TargetName="rectangle4" Value="0" />
              <Setter Property="Margin" TargetName="border3" Value="0,0,0,1" />
            </MultiTrigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="HasLeftGroupBorder" Value="False" />
                <Condition Property="HasRightGroupBorder" Value="False" />
              </MultiTrigger.Conditions>
              <Setter Property="BorderThickness" TargetName="border4" Value="0,0,0,0" />
              <Setter Property="BorderThickness" TargetName="border3" Value="0,0,0,0" />
              <Setter Property="Margin" TargetName="rectangle4" Value="0" />
              <Setter Property="Margin" TargetName="border3" Value="0,0,0,1" />
            </MultiTrigger>
            <!--<MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="HasLeftGroupBorder"
                                           Value="True" />
                                <Condition Property="HasRightGroupBorder"
                                           Value="True" />
                            </MultiTrigger.Conditions>
                            <Setter Property="Margin"
                                    TargetName="rectangle4"
                                    Value="0" />
                            <Setter Property="BorderThickness"
                                    TargetName="border4"
                                    Value="1,0,1,0" />
                            <Setter Property="BorderThickness"
                                    TargetName="border3"
                                    Value="1,0,1,0" />
                            <Setter Property="Margin"
                                    TargetName="border3"
                                    Value="1,0,0,1" />
                        </MultiTrigger>-->
            <Trigger Property="Group" Value="{x:Null}">
              <Setter Property="Visibility" TargetName="border3" Value="Collapsed" />
              <Setter Property="Margin" TargetName="separatorGrid" Value="-1,0,0,1" />
              <Setter Property="Visibility" TargetName="border_Copy3" Value="Collapsed" />
              <Setter Property="Visibility" TargetName="rectangle3" Value="Collapsed" />
            </Trigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="Selector.IsSelected" Value="True" />
                <Condition Property="IsMinimized" Value="False" />
                <Condition Property="Fluent:RibbonTabControl.HighlightSelectedItem" Value="True" />
              </MultiTrigger.Conditions>
              <Setter Property="Visibility" TargetName="selectedGrid" Value="Visible" />
            </MultiTrigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsMouseOver" Value="True" />
                <Condition Property="Selector.IsSelected" Value="False" />
                <Condition Property="IsMinimized" Value="False" />
              </MultiTrigger.Conditions>
              <Setter Property="Visibility" TargetName="hoverGrid" Value="Visible" />
            </MultiTrigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsMouseOver" Value="True" />
                <Condition Property="IsMinimized" Value="True" />
                <Condition Property="IsOpen" Value="False" />
              </MultiTrigger.Conditions>
              <Setter Property="Visibility" TargetName="hoverGrid" Value="Visible" />
            </MultiTrigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="Selector.IsSelected" Value="True" />
                <Condition Property="IsMinimized" Value="True" />
                <Condition Property="IsOpen" Value="True" />
              </MultiTrigger.Conditions>
              <Setter Property="Visibility" TargetName="hoverGrid" Value="Visible" />
              <Setter Property="Background" TargetName="grid" Value="#00000000" />
            </MultiTrigger>
            <Trigger Property="IsSeparatorVisible" Value="True">
              <Setter Property="Visibility" TargetName="separatorGrid" Value="Visible" />
              <Setter Property="Margin" TargetName="PART_ContentContainer" Value="6,2,6,0" />
              <Setter Property="Margin" TargetName="hoverGrid" Value="2,0" />
              <Setter Property="Margin" TargetName="selectedGrid" Value="2,0" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="IsTabStop" Value="False" />
    <Setter Property="Indent" Value="12" />
    <Setter Property="Foreground" Value="{StaticResource TabItemSelectedFontBrush}" />
    <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}" />
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
    <Setter Property="Margin" Value="0" />
    <Setter Property="BorderBrush" Value="{Binding Group.BorderBrush, RelativeSource={RelativeSource Self}}" />
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlStyleEmptyFocus}" />
  </Style>
  <Style TargetType="Separator" x:Key="GroupBoxSeparator">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="Separator">
          <Border Width="3" Height="55" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2,5,2,10" BorderThickness="1,0" BorderBrush="{StaticResource GroupBoxSeparatorBorderBrush}" Background="{StaticResource GroupBoxSeparatorBackgroundBrush}" />
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <ControlTemplate x:Key="DialogLauncherButtonControlTemplate" TargetType="{x:Type Fluent:Button}">
    <Border x:Name="border" BorderThickness="1" CornerRadius="1,0,0,0" Background="{StaticResource TransparentBrush}" BorderBrush="{StaticResource TransparentBrush}">
      <Border x:Name="border1" Width="Auto" Height="Auto" BorderThickness="1" CornerRadius="1,0,0,0" Background="{StaticResource TransparentBrush}" BorderBrush="{StaticResource TransparentBrush}">
        <Image x:Name="image" Height="Auto" HorizontalAlignment="Center" VerticalAlignment="Center" Source="pack://application:,,,/Fluent;Component\Themes\Office2010\Images\DialogLauncher.png" SnapsToDevicePixels="True" Stretch="None" RenderTransformOrigin="0.5,0.5">
          <Image.RenderTransform>
            <TransformGroup>
              <ScaleTransform />
              <SkewTransform />
              <RotateTransform />
              <TranslateTransform />
            </TransformGroup>
          </Image.RenderTransform>
        </Image>
      </Border>
    </Border>
    <ControlTemplate.Triggers>
      <Trigger Property="FlowDirection" Value="RightToLeft">
        <Setter Property="RenderTransform" TargetName="image">
          <Setter.Value>
            <TransformGroup>
              <ScaleTransform ScaleX="-1" />
              <SkewTransform />
              <RotateTransform />
              <TranslateTransform />
            </TransformGroup>
          </Setter.Value>
        </Setter>
      </Trigger>
      <Trigger Property="IsPressed" Value="True">
        <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonPressedOuterBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonPressedOuterBorderBrush}" />
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonPressedInnerBorderBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonPressedInnerBackgroundBrush}" />
      </Trigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsMouseOver" Value="True" />
          <Condition Property="IsPressed" Value="False" />
        </MultiTrigger.Conditions>
        <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
        <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
      </MultiTrigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <Style x:Key="ToolTipStyle" TargetType="{x:Type ToolTip}">
    <Setter Property="Foreground" Value="{StaticResource DefaultFontBrush}" />
    <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}" />
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
    <Setter Property="Template">
      <Setter.Value>
        <!--<ControlTemplate TargetType="Label">-->
        <ControlTemplate TargetType="{x:Type ToolTip}">
          <Grid>
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="*" />
              <ColumnDefinition Width="5" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
              <RowDefinition Height="*" />
              <RowDefinition Height="5" />
            </Grid.RowDefinitions>
            <Rectangle Stroke="{x:Null}" StrokeThickness="0" HorizontalAlignment="Stretch" Margin="11,-1,1,0" VerticalAlignment="Stretch" Height="Auto" Grid.Column="0" Grid.Row="1" Grid.RowSpan="1">
              <Rectangle.Fill>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" MappingMode="RelativeToBoundingBox">
                  <GradientStop Color="#7F000000" Offset="0" />
                  <GradientStop Offset="1" Color="#00000000" />
                </LinearGradientBrush>
              </Rectangle.Fill>
            </Rectangle>
            <Rectangle Stroke="{x:Null}" StrokeThickness="0" HorizontalAlignment="Stretch" Margin="-1,11,0,1" VerticalAlignment="Stretch" Height="Auto" Grid.Column="1" Grid.Row="0" Grid.RowSpan="1">
              <Rectangle.Fill>
                <LinearGradientBrush EndPoint="1.002,0" MappingMode="RelativeToBoundingBox">
                  <GradientStop Color="#7F000000" Offset="0" />
                  <GradientStop Offset="1" Color="#00000000" />
                </LinearGradientBrush>
              </Rectangle.Fill>
            </Rectangle>
            <Rectangle Stroke="{x:Null}" StrokeThickness="0" HorizontalAlignment="Stretch" Margin="-1,-1,0,0" VerticalAlignment="Stretch" Height="Auto" Grid.Column="1" Grid.Row="1" Grid.RowSpan="1">
              <Rectangle.Fill>
                <RadialGradientBrush Center="-0.003,0.011" GradientOrigin="-0.003,0.011" RadiusX="1.006" RadiusY="1">
                  <GradientStop Color="#7F000000" Offset="0.002" />
                  <GradientStop Offset="1" Color="#00000000" />
                </RadialGradientBrush>
              </Rectangle.Fill>
            </Rectangle>
            <Rectangle Stroke="{x:Null}" StrokeThickness="0" HorizontalAlignment="Stretch" Margin="-1,5,0,0" VerticalAlignment="Top" Height="6" Grid.Column="1" Grid.Row="0" Grid.RowSpan="1">
              <Rectangle.Fill>
                <RadialGradientBrush Center="-0.01,1.004" GradientOrigin="-0.01,1.004" RadiusX="1.006" RadiusY="1">
                  <GradientStop Color="#7F000000" Offset="0.002" />
                  <GradientStop Offset="1" Color="#00000000" />
                </RadialGradientBrush>
              </Rectangle.Fill>
            </Rectangle>
            <Rectangle Stroke="{x:Null}" StrokeThickness="0" HorizontalAlignment="Left" Margin="5,-1,0,0" VerticalAlignment="Stretch" Height="Auto" Grid.Column="0" Grid.Row="1" Grid.RowSpan="1" Width="6">
              <Rectangle.Fill>
                <RadialGradientBrush Center="1.003,-0.006" GradientOrigin="1.003,-0.006" RadiusX="1.006" RadiusY="1">
                  <GradientStop Color="#7F000000" Offset="0.002" />
                  <GradientStop Offset="1" Color="#00000000" />
                </RadialGradientBrush>
              </Rectangle.Fill>
            </Rectangle>
            <Border Grid.RowSpan="1" CornerRadius="2" BorderThickness="1" BorderBrush="{StaticResource ScreenTipBorderBrush}" Background="{StaticResource ScreenTipBackgroundBrush}">
              <ContentPresenter Margin="4,4,4,4" />
            </Border>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="ScreenTipStyle" TargetType="{x:Type Fluent:ScreenTip}">
    <!--<Style x:Key="FFF" TargetType="Label">-->
    <Setter Property="Foreground" Value="{StaticResource DefaultFontBrush}" />
    <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}" />
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
    <Setter Property="Template">
      <Setter.Value>
        <!--<ControlTemplate TargetType="Label">-->
        <ControlTemplate TargetType="{x:Type Fluent:ScreenTip}">
          <Grid>
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="*" />
              <ColumnDefinition Width="5" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
              <RowDefinition Height="*" />
              <RowDefinition Height="5" />
            </Grid.RowDefinitions>
            <Rectangle Stroke="{x:Null}" StrokeThickness="0" HorizontalAlignment="Stretch" Margin="11,-1,1,0" VerticalAlignment="Stretch" Height="Auto" Grid.Column="0" Grid.Row="1" Grid.RowSpan="1">
              <Rectangle.Fill>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" MappingMode="RelativeToBoundingBox">
                  <GradientStop Color="#7F000000" Offset="0" />
                  <GradientStop Offset="1" Color="#00000000" />
                </LinearGradientBrush>
              </Rectangle.Fill>
            </Rectangle>
            <Rectangle Stroke="{x:Null}" StrokeThickness="0" HorizontalAlignment="Stretch" Margin="-1,11,0,1" VerticalAlignment="Stretch" Height="Auto" Grid.Column="1" Grid.Row="0" Grid.RowSpan="1">
              <Rectangle.Fill>
                <LinearGradientBrush EndPoint="1.002,0" MappingMode="RelativeToBoundingBox">
                  <GradientStop Color="#7F000000" Offset="0" />
                  <GradientStop Offset="1" Color="#00000000" />
                </LinearGradientBrush>
              </Rectangle.Fill>
            </Rectangle>
            <Rectangle Stroke="{x:Null}" StrokeThickness="0" HorizontalAlignment="Stretch" Margin="-1,-1,0,0" VerticalAlignment="Stretch" Height="Auto" Grid.Column="1" Grid.Row="1" Grid.RowSpan="1">
              <Rectangle.Fill>
                <RadialGradientBrush Center="-0.003,0.011" GradientOrigin="-0.003,0.011" RadiusX="1.006" RadiusY="1">
                  <GradientStop Color="#7F000000" Offset="0.002" />
                  <GradientStop Offset="1" Color="#00000000" />
                </RadialGradientBrush>
              </Rectangle.Fill>
            </Rectangle>
            <Rectangle Stroke="{x:Null}" StrokeThickness="0" HorizontalAlignment="Stretch" Margin="-1,5,0,0" VerticalAlignment="Top" Height="6" Grid.Column="1" Grid.Row="0" Grid.RowSpan="1">
              <Rectangle.Fill>
                <RadialGradientBrush Center="-0.01,1.004" GradientOrigin="-0.01,1.004" RadiusX="1.006" RadiusY="1">
                  <GradientStop Color="#7F000000" Offset="0.002" />
                  <GradientStop Offset="1" Color="#00000000" />
                </RadialGradientBrush>
              </Rectangle.Fill>
            </Rectangle>
            <Rectangle Stroke="{x:Null}" StrokeThickness="0" HorizontalAlignment="Left" Margin="5,-1,0,0" VerticalAlignment="Stretch" Height="Auto" Grid.Column="0" Grid.Row="1" Grid.RowSpan="1" Width="6">
              <Rectangle.Fill>
                <RadialGradientBrush Center="1.003,-0.006" GradientOrigin="1.003,-0.006" RadiusX="1.006" RadiusY="1">
                  <GradientStop Color="#7F000000" Offset="0.002" />
                  <GradientStop Offset="1" Color="#00000000" />
                </RadialGradientBrush>
              </Rectangle.Fill>
            </Rectangle>
            <Border Grid.RowSpan="1" CornerRadius="2" BorderThickness="1" BorderBrush="{StaticResource ScreenTipBorderBrush}" Background="{StaticResource ScreenTipBackgroundBrush}">
              <Grid>
                <StackPanel x:Name="screenTipPanel">
                  <TextBlock x:Name="title" TextWrapping="Wrap" Margin="7,8,7,10" FontWeight="Bold" Text="{TemplateBinding Property=Title}" />
                  <Grid x:Name="imageAndTextSection">
                    <Grid.ColumnDefinitions>
                      <ColumnDefinition Width="Auto" />
                      <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Image Margin="7,5,3,7" HorizontalAlignment="Left" VerticalAlignment="Top" Source="{TemplateBinding Property=Image}" MaxHeight="48" />
                    <TextBlock Text="{TemplateBinding Property=Text}" TextWrapping="Wrap" Margin="8,0,8,6" Foreground="#FF414141" Grid.Column="1" />
                  </Grid>
                  <Border x:Name="separator" Height="2" Width="Auto" HorizontalAlignment="Stretch" Visibility="{Binding ElementName=disableReasonSection, Path=Visibility}" BorderBrush="White" Margin="5" Background="#FF9199A4" BorderThickness="0,0,0,1" IsEnabled="{Binding Path=(IsEnabled), RelativeSource={RelativeSource FindAncestor, AncestorType=Control, AncestorLevel=2}}" />
                  <Grid x:Name="disableReasonSection">
                    <Image Width="16" Height="16" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="5,0,0,0" Source="pack://application:,,,/Fluent;component\Themes\Office2010\Images\WarningSmall.png" />
                    <Grid>
                      <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                      </Grid.RowDefinitions>
                      <TextBlock x:Name="disableReasonHeader" x:Uid="disableReasonHeader" Text="{Binding Source={x:Static Fluent:Ribbon.Localization}, Path=ScreenTipDisableReasonHeader, Mode=OneWay}" TextWrapping="Wrap" Margin="28,0,5,2" Foreground="#FF414141" HorizontalAlignment="Stretch" Grid.Row="0" FontWeight="Bold" />
                      <TextBlock x:Name="disableReasonText" Text="{TemplateBinding Property=DisableReason}" TextWrapping="Wrap" Margin="28,0,5,6" Foreground="#FF414141" HorizontalAlignment="Stretch" Grid.Row="1" />
                      <TextBlock x:Name="helpText" TextWrapping="Wrap" Margin="28,0,5,6" Foreground="#FF414141" Grid.RowSpan="1" Grid.Row="2" HorizontalAlignment="Stretch" Text="{Binding Text, ElementName=textBlock, Mode=Default}" />
                    </Grid>
                  </Grid>
                  <Border x:Name="separator2" Height="2" Width="Auto" HorizontalAlignment="Stretch" Visibility="{TemplateBinding Property=HelpLabelVisibility}" BorderBrush="White" Margin="5" Background="#FF9199A4" BorderThickness="0,0,0,1" />
                  <Grid x:Name="helpSection" Visibility="{TemplateBinding Property=HelpLabelVisibility}">
                    <Image Width="16" Height="16" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="5,0,0,0" Source="pack://application:,,,/Fluent;component\Themes\Office2010\Images\HelpSmall.png" />
                    <TextBlock x:Uid="HelpText" x:Name="textBlock" Text="{Binding Source={x:Static Fluent:Ribbon.Localization}, Path=ScreenTipF1LabelHeader, Mode=OneWay}" TextWrapping="Wrap" Margin="28,0,6,6" Foreground="#FF414141" FontWeight="Bold" HorizontalAlignment="Stretch" />
                    <ContentControl x:Name="helpTopic" Content="{TemplateBinding Property=HelpTopic}" Visibility="Collapsed" />
                  </Grid>
                </StackPanel>
              </Grid>
            </Border>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsEnabled" SourceName="separator" Value="False">
              <Setter Property="Visibility" TargetName="disableReasonSection" Value="Visible" />
            </Trigger>
            <Trigger Property="IsEnabled" SourceName="separator" Value="True">
              <Setter Property="Visibility" TargetName="disableReasonSection" Value="Collapsed" />
            </Trigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="Content" SourceName="helpTopic" Value="{x:Null}" />
                <Condition Property="Text" Value="" SourceName="disableReasonText" />
              </MultiTrigger.Conditions>
              <Setter Property="Visibility" TargetName="separator" Value="Collapsed" />
            </MultiTrigger>
            <Trigger Property="Text" SourceName="disableReasonText" Value="">
              <Setter Property="Visibility" TargetName="disableReasonSection" Value="Collapsed" />
            </Trigger>
            <Trigger Property="Content" SourceName="helpTopic" Value="{x:Null}">
              <Setter Property="Visibility" TargetName="helpText" Value="Collapsed" />
              <Setter Property="Visibility" TargetName="helpSection" Value="Collapsed" />
              <Setter Property="Visibility" TargetName="separator2" Value="Collapsed" />
            </Trigger>
            <Trigger Property="Visibility" SourceName="disableReasonSection" Value="Visible">
              <Setter Property="Visibility" TargetName="helpText" Value="Collapsed" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="TwoLineLabelStyle" TargetType="{x:Type Fluent:TwoLineLabel}">
    <Setter Property="Template" Value="{StaticResource TwoLineLabelControlTemplate}" />
  </Style>
  <ControlTemplate x:Key="RibbonButtonControlTemplate" TargetType="{x:Type Fluent:Button}">
    <Border x:Name="border" BorderThickness="1" CornerRadius="2" Background="{StaticResource TransparentBrush}" BorderBrush="{StaticResource TransparentBrush}" Height="Auto" HorizontalAlignment="Left" VerticalAlignment="Stretch">
      <Border x:Name="border1" Height="Auto" BorderBrush="{StaticResource TransparentBrush}" BorderThickness="1" CornerRadius="2" Background="{StaticResource TransparentBrush}">
        <Grid Height="Auto">
          <Rectangle x:Name="rectangle" StrokeThickness="0" Visibility="Collapsed">
            <Rectangle.Fill>
              <RadialGradientBrush Center="0.503,1" GradientOrigin="0.503,1" RadiusY="0.202">
                <GradientStop Color="#7FFFFFFF" Offset="0" />
                <GradientStop Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <StackPanel x:Name="stackPanel" Width="Auto" Orientation="Vertical" d:LayoutOverrides="Width, Height">
            <ContentPresenter x:Name="iconImage" HorizontalAlignment="Center" Height="32" VerticalAlignment="Center" Content="{Binding LargeIcon, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource StringToImageConvert}}" Width="32" Margin="3,2,3,1" SnapsToDevicePixels="True" />
            <Fluent:TwoLineLabel x:Name="controlLabel" Text="{TemplateBinding Header}" Style="{StaticResource TwoLineLabelStyle}" HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="2,-1,2,2" />
          </StackPanel>
        </Grid>
      </Border>
    </Border>
    <ControlTemplate.Triggers>
      <Trigger Property="Size" Value="Small">
        <Setter Property="Orientation" TargetName="stackPanel" Value="Horizontal" />
        <Setter Property="Visibility" TargetName="controlLabel" Value="Collapsed" />
        <Setter Property="HasTwoLines" TargetName="controlLabel" Value="False" />
        <Setter Property="Width" TargetName="iconImage" Value="16" />
        <Setter Property="Height" TargetName="iconImage" Value="16" />
        <Setter Property="Margin" TargetName="iconImage" Value="1,0,2,0" />
        <Setter Property="Content" TargetName="iconImage" Value="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource StringToImageConvert}}" />
        <Setter Property="Margin" TargetName="controlLabel" Value="2,-1,2,1" />
      </Trigger>
      <Trigger Property="Size" Value="Middle">
        <Setter Property="Orientation" TargetName="stackPanel" Value="Horizontal" />
        <Setter Property="Width" TargetName="stackPanel" Value="Auto" />
        <Setter Property="VerticalAlignment" TargetName="iconImage" Value="Center" />
        <Setter Property="HasTwoLines" TargetName="controlLabel" Value="False" />
        <Setter Property="Margin" TargetName="controlLabel" Value="2,-1,2,1" />
        <Setter Property="VerticalAlignment" TargetName="border" Value="Stretch" />
        <Setter Property="Width" TargetName="iconImage" Value="16" />
        <Setter Property="Height" TargetName="iconImage" Value="16" />
        <Setter Property="Margin" TargetName="iconImage" Value="1,0,2,0" />
        <Setter Property="Content" TargetName="iconImage" Value="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource StringToImageConvert}}" />
        <Setter Property="VerticalAlignment" TargetName="controlLabel" Value="Center" />
      </Trigger>
      <Trigger Property="IsPressed" Value="True">
        <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonPressedOuterBorderBrush}" />
        <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonPressedOuterBackgroundBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonPressedInnerBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonPressedInnerBorderBrush}" />
      </Trigger>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="Opacity" TargetName="iconImage" Value="0.5" />
        <Setter Property="Opacity" TargetName="controlLabel" Value="0.5" />
        <Setter Property="Effect" TargetName="iconImage">
          <Setter.Value>
            <Fluent:GrayscaleEffect />
          </Setter.Value>
        </Setter>
      </Trigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsMouseOver" Value="True" />
          <Condition Property="IsPressed" Value="False" />
          <Condition Property="IsEnabled" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
        <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
        <Setter Property="Visibility" TargetName="rectangle" Value="Visible" />
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsKeyboardFocusWithin" Value="True" />
          <Condition Property="IsPressed" Value="False" />
        </MultiTrigger.Conditions>
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
        <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
      </MultiTrigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <Style x:Key="RibbonButtonStyle" TargetType="{x:Type Fluent:Button}">
    <Setter Property="Template" Value="{StaticResource RibbonButtonControlTemplate}" />
    <Setter Property="Height" Value="68" />
    <Setter Property="Width" Value="Auto" />
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
    <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}" />
    <Setter Property="Foreground" Value="{StaticResource DefaultFontBrush}" />
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlStyleEmptyFocus}" />
    <Setter Property="SnapsToDevicePixels" Value="False" />
    <Style.Triggers>
      <Trigger Property="Fluent:RibbonControl.Size" Value="Large">
        <Setter Property="Height" Value="68" />
      </Trigger>
      <Trigger Property="Fluent:RibbonControl.Size" Value="Middle">
        <Setter Property="Height" Value="22" />
        <Setter Property="HorizontalAlignment" Value="Left" />
      </Trigger>
      <Trigger Property="Fluent:RibbonControl.Size" Value="Small">
        <Setter Property="Height" Value="22" />
        <Setter Property="Width" Value="22" />
        <Setter Property="HorizontalAlignment" Value="Left" />
      </Trigger>
    </Style.Triggers>
  </Style>
  <Style TargetType="{x:Type Fluent:Button}" BasedOn="{StaticResource RibbonButtonStyle}" />
  <ControlTemplate x:Key="RibbonToggleButtonControlTemplate" TargetType="{x:Type Fluent:ToggleButton}">
    <Border x:Name="border" BorderThickness="1" CornerRadius="2" Background="{StaticResource TransparentBrush}" BorderBrush="{StaticResource TransparentBrush}" Height="Auto" HorizontalAlignment="Left" VerticalAlignment="Stretch">
      <Border x:Name="border1" Height="Auto" BorderBrush="{StaticResource TransparentBrush}" BorderThickness="1" CornerRadius="2" Background="{StaticResource TransparentBrush}">
        <Grid Height="Auto">
          <Rectangle x:Name="rectangle" StrokeThickness="0" Visibility="Collapsed">
            <Rectangle.Fill>
              <RadialGradientBrush Center="0.503,1" GradientOrigin="0.503,1" RadiusY="0.202">
                <GradientStop Color="#7FFFFFFF" Offset="0" />
                <GradientStop Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <StackPanel x:Name="stackPanel" Width="Auto" Orientation="Vertical" d:LayoutOverrides="Width, Height">
            <ContentPresenter x:Name="iconImage" HorizontalAlignment="Center" Height="32" VerticalAlignment="Center" Content="{Binding LargeIcon, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource StringToImageConvert}}" Width="32" Margin="2" SnapsToDevicePixels="True" />
            <Fluent:TwoLineLabel x:Name="controlLabel" Text="{TemplateBinding Header}" Style="{StaticResource TwoLineLabelStyle}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="2,-2,2,2" />
          </StackPanel>
        </Grid>
      </Border>
    </Border>
    <ControlTemplate.Triggers>
      <Trigger Property="Fluent:RibbonControl.Size" Value="Small">
        <Setter Property="Orientation" TargetName="stackPanel" Value="Horizontal" />
        <Setter Property="Visibility" TargetName="controlLabel" Value="Collapsed" />
        <Setter Property="HasTwoLines" TargetName="controlLabel" Value="False" />
        <Setter Property="Width" TargetName="iconImage" Value="16" />
        <Setter Property="Height" TargetName="iconImage" Value="16" />
        <Setter Property="Margin" TargetName="iconImage" Value="1,0,2,0" />
        <Setter Property="Content" TargetName="iconImage" Value="{Binding Path=Icon, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource StringToImageConvert}}" />
        <Setter Property="Margin" TargetName="controlLabel" Value="2,-2,2,2" />
      </Trigger>
      <Trigger Property="Fluent:RibbonControl.Size" Value="Middle">
        <Setter Property="Orientation" TargetName="stackPanel" Value="Horizontal" />
        <Setter Property="Width" TargetName="stackPanel" Value="Auto" />
        <Setter Property="VerticalAlignment" TargetName="iconImage" Value="Center" />
        <Setter Property="HasTwoLines" TargetName="controlLabel" Value="False" />
        <Setter Property="Margin" TargetName="controlLabel" Value="2,2,2,2" />
        <Setter Property="VerticalAlignment" TargetName="border" Value="Stretch" />
        <Setter Property="Width" TargetName="iconImage" Value="16" />
        <Setter Property="Height" TargetName="iconImage" Value="16" />
        <Setter Property="Margin" TargetName="iconImage" Value="1,0,2,0" />
        <Setter Property="VerticalAlignment" TargetName="controlLabel" Value="Center" />
        <Setter Property="Content" TargetName="iconImage" Value="{Binding Path=Icon, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource StringToImageConvert}}" />
      </Trigger>
      <Trigger Property="IsPressed" Value="True">
        <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonPressedOuterBorderBrush}" />
        <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonPressedOuterBackgroundBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonPressedInnerBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonPressedInnerBorderBrush}" />
      </Trigger>
      <Trigger Property="IsChecked" Value="True">
        <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonPressedOuterBorderBrush}" />
        <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonPressedInnerBorderBrush}" />
      </Trigger>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="Opacity" TargetName="iconImage" Value="0.5" />
        <Setter Property="Opacity" TargetName="controlLabel" Value="0.5" />
        <Setter Property="Effect" TargetName="iconImage">
          <Setter.Value>
            <Fluent:GrayscaleEffect />
          </Setter.Value>
        </Setter>
      </Trigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsMouseOver" Value="True" />
          <Condition Property="IsPressed" Value="False" />
        </MultiTrigger.Conditions>
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
        <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
        <Setter Property="Visibility" TargetName="rectangle" Value="Visible" />
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsKeyboardFocusWithin" Value="True" />
          <Condition Property="IsPressed" Value="False" />
        </MultiTrigger.Conditions>
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
        <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsMouseOver" Value="True" />
          <Condition Property="IsPressed" Value="False" />
          <Condition Property="IsChecked" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
        <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonPressedOuterBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonPressedOuterBorderBrush}" />
        <Setter Property="Visibility" TargetName="rectangle" Value="Visible" />
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsKeyboardFocusWithin" Value="True" />
          <Condition Property="IsPressed" Value="False" />
          <Condition Property="IsChecked" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
        <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonPressedOuterBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonPressedOuterBorderBrush}" />
      </MultiTrigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <ControlTemplate x:Key="InnerButtonControlTemplate" TargetType="{x:Type Fluent:ToggleButton}">
    <Border x:Name="border" BorderThickness="1" CornerRadius="2,2,0,0" Background="{StaticResource TransparentBrush}" BorderBrush="{StaticResource TransparentBrush}" Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" SnapsToDevicePixels="False">
      <Border x:Name="border1" Height="Auto" BorderBrush="{StaticResource TransparentBrush}" BorderThickness="1" CornerRadius="2,2,0,0" Background="{StaticResource TransparentBrush}">
        <Grid Height="Auto">
          <Rectangle x:Name="rectangle" StrokeThickness="0" Visibility="Collapsed">
            <Rectangle.Fill>
              <RadialGradientBrush Center="0.503,1" GradientOrigin="0.503,1" RadiusY="0.202">
                <GradientStop Color="#7FFFFFFF" Offset="0" />
                <GradientStop Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <StackPanel x:Name="stackPanel" Width="Auto" Orientation="Vertical" d:LayoutOverrides="Width, Height" HorizontalAlignment="Stretch" SnapsToDevicePixels="True">
            <ContentPresenter x:Name="iconImage" HorizontalAlignment="Center" Height="32" VerticalAlignment="Center" Content="{TemplateBinding LargeIcon}" Width="32" Margin="0,2,0,1" SnapsToDevicePixels="True" />
            <Fluent:TwoLineLabel x:Name="controlLabel" Text="{TemplateBinding Header}" Style="{StaticResource TwoLineLabelStyle}" HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="2,-1,2,2" Visibility="Collapsed" />
          </StackPanel>
        </Grid>
      </Border>
    </Border>
    <ControlTemplate.Triggers>
      <Trigger Property="IsPressed" Value="True">
        <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonPressedOuterBorderBrush}" />
        <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonPressedOuterBackgroundBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonPressedInnerBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonPressedInnerBorderBrush}" />
      </Trigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsMouseOver" Value="True" />
          <Condition Property="IsPressed" Value="False" />
          <Condition Property="IsEnabled" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
        <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
        <Setter Property="Visibility" TargetName="rectangle" Value="Visible" />
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsKeyboardFocusWithin" Value="True" />
          <Condition Property="IsPressed" Value="False" />
          <Condition Property="IsEnabled" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
        <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
      </MultiTrigger>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="Opacity" TargetName="iconImage" Value="0.5" />
        <Setter Property="Opacity" TargetName="controlLabel" Value="0.5" />
        <Setter Property="Effect" TargetName="iconImage">
          <Setter.Value>
            <Fluent:GrayscaleEffect />
          </Setter.Value>
        </Setter>
      </Trigger>
      <Trigger Property="Size" Value="Small">
        <Setter Property="Orientation" TargetName="stackPanel" Value="Horizontal" />
        <Setter Property="Visibility" TargetName="controlLabel" Value="Collapsed" />
        <Setter Property="HasTwoLines" TargetName="controlLabel" Value="False" />
        <Setter Property="Width" TargetName="iconImage" Value="16" />
        <Setter Property="Height" TargetName="iconImage" Value="16" />
        <Setter Property="Margin" TargetName="iconImage" Value="1,0,2,0" />
        <Setter Property="Content" TargetName="iconImage" Value="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}}" />
        <Setter Property="CornerRadius" TargetName="border" Value="2,0,0,2" />
        <Setter Property="CornerRadius" TargetName="border1" Value="2,0,0,2" />
        <Setter Property="Margin" TargetName="controlLabel" Value="2,-1,2,1" />
      </Trigger>
      <Trigger Property="Size" Value="Middle">
        <Setter Property="Orientation" TargetName="stackPanel" Value="Horizontal" />
        <Setter Property="Width" TargetName="stackPanel" Value="Auto" />
        <Setter Property="VerticalAlignment" TargetName="iconImage" Value="Center" />
        <Setter Property="HasTwoLines" TargetName="controlLabel" Value="False" />
        <Setter Property="Margin" TargetName="controlLabel" Value="2,-1,-1,1" />
        <Setter Property="VerticalAlignment" TargetName="border" Value="Stretch" />
        <Setter Property="Width" TargetName="iconImage" Value="16" />
        <Setter Property="Height" TargetName="iconImage" Value="16" />
        <Setter Property="Margin" TargetName="iconImage" Value="1,0,2,0" />
        <Setter Property="Content" TargetName="iconImage" Value="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}}" />
        <Setter Property="CornerRadius" TargetName="border1" Value="2,0,0,2" />
        <Setter Property="CornerRadius" TargetName="border" Value="2,0,0,2" />
        <Setter Property="Visibility" TargetName="controlLabel" Value="Visible" />
        <Setter Property="VerticalAlignment" TargetName="controlLabel" Value="Center" />
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <Style x:Key="RibbonCheckBoxStyle" TargetType="{x:Type Fluent:CheckBox}">
    <Setter Property="ToolTipService.ShowDuration" Value="30000" />
    <Setter Property="FocusVisualStyle">
      <Setter.Value>
        <Style>
          <Setter Property="Control.Template">
            <Setter.Value>
              <ControlTemplate>
                <Rectangle Margin="1" SnapsToDevicePixels="true" Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" />
              </ControlTemplate>
            </Setter.Value>
          </Setter>
        </Style>
      </Setter.Value>
    </Setter>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Fluent:CheckBox}">
          <BulletDecorator SnapsToDevicePixels="true" Background="Transparent" x:Name="bulletDecorator" Height="22">
            <BulletDecorator.Bullet>
              <Grid Width="13" Height="13" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="4,4,0,0">
                <Rectangle x:Name="rectangle" Fill="{StaticResource CheckBoxOutterBackgroundBrush}" Stroke="{StaticResource CheckBoxOutterBorderBrush}" />
                <Rectangle x:Name="rectangle1" Margin="1,1,1,1" Fill="{x:Null}" Stroke="{StaticResource CheckBoxOutterBackgroundBrush}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
                <Rectangle Margin="2,2,2,2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" x:Name="defaultRect" Opacity="1" Stroke="{StaticResource CheckBoxInnerBorderBrush}" Fill="{StaticResource CheckBoxInnerBackgroundBrush}" />
                <Rectangle x:Name="rectangle2" StrokeThickness="0" Margin="2" Opacity="0">
                  <Rectangle.Fill>
                    <RadialGradientBrush Center="0.496,1.004" GradientOrigin="0.496,1.004">
                      <GradientStop Color="White" />
                      <GradientStop Offset="1" />
                    </RadialGradientBrush>
                  </Rectangle.Fill>
                </Rectangle>
                <Path Margin="3,3,3,3" VerticalAlignment="Stretch" Stretch="Fill" Data="M2.0594839,6.6033333 L5.8330001,9.4978325 10.00636,1.7586203" Fill="{x:Null}" Stroke="#FF6E7071" StrokeEndLineCap="Triangle" StrokeDashCap="Square" StrokeThickness="2" StrokeStartLineCap="Triangle" x:Name="path">
                  <Path.BitmapEffect>
                    <OuterGlowBitmapEffect GlowColor="#BFFFFFFF" GlowSize="1" Opacity="1" />
                  </Path.BitmapEffect>
                </Path>
              </Grid>
            </BulletDecorator.Bullet>
            <TextBlock Text="{TemplateBinding Header}" Margin="8,3,4,0" />
          </BulletDecorator>
          <ControlTemplate.Triggers>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsMouseOver" Value="True" />
                <Condition Property="IsPressed" Value="False" />
              </MultiTrigger.Conditions>
              <Setter Property="Stroke" TargetName="rectangle" Value="{StaticResource CheckBoxHoverOutterBorderBrush}" />
              <Setter Property="Fill" TargetName="rectangle" Value="{StaticResource CheckBoxHoverOutterBackgroundBrush}" />
              <Setter Property="Stroke" TargetName="rectangle1" Value="{StaticResource CheckBoxHoverOutterBackgroundBrush}" />
              <Setter Property="Stroke" TargetName="defaultRect" Value="{StaticResource CheckBoxHoverInnerBorderBrush}" />
              <Setter Property="Fill" TargetName="defaultRect" Value="{StaticResource CheckBoxHoverInnerBackgroundBrush}" />
              <Setter Property="Stroke" TargetName="path" Value="Black" />
              <Setter Property="Opacity" TargetName="rectangle2" Value="0.25" />
            </MultiTrigger>
            <Trigger Property="IsPressed" Value="True">
              <Setter Property="Stroke" TargetName="rectangle" Value="{StaticResource CheckBoxPressedOutterBorderBrush}" />
              <Setter Property="Fill" TargetName="rectangle" Value="{StaticResource CheckBoxPressedOutterBackgroundBrush}" />
              <Setter Property="Stroke" TargetName="rectangle1" Value="{StaticResource CheckBoxPressedOutterBackgroundBrush}" />
              <Setter Property="Stroke" TargetName="defaultRect" Value="{StaticResource CheckBoxPressedInnerBorderBrush}" />
              <Setter Property="Fill" TargetName="defaultRect" Value="{StaticResource CheckBoxPressedInnerBackgroundBrush}" />
              <Setter Property="Stroke" TargetName="path" Value="Black" />
              <Setter Property="Opacity" TargetName="rectangle2" Value="0.5" />
            </Trigger>
            <Trigger Property="IsChecked" Value="False">
              <Setter Property="Visibility" TargetName="path" Value="Hidden" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
              <Setter Property="Opacity" TargetName="bulletDecorator" Value="0.3" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="Foreground" Value="#FF464646" />
  </Style>
  <Style TargetType="{x:Type Fluent:CheckBox}" BasedOn="{StaticResource RibbonCheckBoxStyle}" />
  <Style x:Key="{x:Type Fluent:RadioButton}" TargetType="{x:Type Fluent:RadioButton}">
    <Setter Property="ToolTipService.ShowDuration" Value="30000" />
    <Setter Property="FocusVisualStyle">
      <Setter.Value>
        <Style>
          <Setter Property="Control.Template">
            <Setter.Value>
              <ControlTemplate>
                <Rectangle Margin="1" SnapsToDevicePixels="true" Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" />
              </ControlTemplate>
            </Setter.Value>
          </Setter>
        </Style>
      </Setter.Value>
    </Setter>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Fluent:RadioButton}">
          <BulletDecorator SnapsToDevicePixels="true" Background="Transparent" x:Name="bulletDecorator" Height="22">
            <BulletDecorator.Bullet>
              <Grid Width="12" Height="12" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="4,4,0,0">
                <Ellipse x:Name="rectangle" Fill="{StaticResource CheckBoxOutterBackgroundBrush}" Stroke="{StaticResource CheckBoxOutterBorderBrush}" />
                <Ellipse x:Name="rectangle1" Margin="1,1,1,1" Fill="{x:Null}" Stroke="{StaticResource CheckBoxOutterBackgroundBrush}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
                <Ellipse Margin="2,2,2,2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" x:Name="defaultRect" Opacity="1" Stroke="{StaticResource CheckBoxInnerBorderBrush}" Fill="{StaticResource CheckBoxInnerBackgroundBrush}" />
                <Ellipse x:Name="rectangle2" StrokeThickness="0" Margin="2" Opacity="0">
                  <Ellipse.Fill>
                    <RadialGradientBrush Center="0.496,1.004" GradientOrigin="0.496,1.004">
                      <GradientStop Color="White" />
                      <GradientStop Offset="1" />
                    </RadialGradientBrush>
                  </Ellipse.Fill>
                </Ellipse>
                <Ellipse Margin="3" VerticalAlignment="Stretch" Stretch="Fill" Stroke="#FF6E7071" StrokeEndLineCap="Triangle" StrokeDashCap="Square" StrokeThickness="1" StrokeStartLineCap="Triangle" x:Name="path">
                  <Ellipse.Fill>
                    <RadialGradientBrush Center="0.367,0.339" GradientOrigin="0.367,0.339">
                      <GradientStop Color="White" Offset="0" />
                      <GradientStop Color="#FF7E8183" Offset="1" />
                    </RadialGradientBrush>
                  </Ellipse.Fill>
                  <Ellipse.BitmapEffect>
                    <OuterGlowBitmapEffect GlowColor="#BFFFFFFF" GlowSize="1" Opacity="1" />
                  </Ellipse.BitmapEffect>
                </Ellipse>
              </Grid>
            </BulletDecorator.Bullet>
            <TextBlock Text="{TemplateBinding Header}" Margin="8,3,4,0" />
          </BulletDecorator>
          <ControlTemplate.Triggers>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsMouseOver" Value="True" />
                <Condition Property="IsPressed" Value="False" />
              </MultiTrigger.Conditions>
              <Setter Property="Stroke" TargetName="rectangle" Value="{StaticResource CheckBoxHoverOutterBorderBrush}" />
              <Setter Property="Stroke" TargetName="rectangle1" Value="{StaticResource CheckBoxHoverOutterBackgroundBrush}" />
              <Setter Property="Stroke" TargetName="defaultRect" Value="{StaticResource CheckBoxHoverInnerBorderBrush}" />
              <Setter Property="Fill" TargetName="defaultRect" Value="{StaticResource CheckBoxHoverInnerBackgroundBrush}" />
              <Setter Property="Opacity" TargetName="rectangle2" Value="0.25" />
            </MultiTrigger>
            <Trigger Property="IsPressed" Value="True">
              <Setter Property="Stroke" TargetName="rectangle" Value="{StaticResource CheckBoxPressedOutterBorderBrush}" />
              <Setter Property="Fill" TargetName="rectangle" Value="{StaticResource CheckBoxPressedOutterBackgroundBrush}" />
              <Setter Property="Stroke" TargetName="rectangle1" Value="{StaticResource CheckBoxPressedOutterBackgroundBrush}" />
              <Setter Property="Stroke" TargetName="defaultRect" Value="{StaticResource CheckBoxPressedInnerBorderBrush}" />
              <Setter Property="Fill" TargetName="defaultRect" Value="{StaticResource CheckBoxPressedInnerBackgroundBrush}" />
              <Setter Property="Stroke" TargetName="path" Value="Black" />
              <Setter Property="Opacity" TargetName="rectangle2" Value="0.5" />
            </Trigger>
            <Trigger Property="IsChecked" Value="False">
              <Setter Property="Visibility" TargetName="path" Value="Hidden" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
              <Setter Property="Opacity" TargetName="bulletDecorator" Value="0.3" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="Foreground" Value="#FF464646" />
  </Style>
  <Style x:Key="GalleryGroupContainerStyle" TargetType="{x:Type Fluent:GalleryGroupContainer}">
    <Setter Property="Template" Value="{StaticResource GalleryGroupContainerTemplate}" />
    <Setter Property="Focusable" Value="False" />
    <Setter Property="ItemsPanel">
      <Setter.Value>
        <ItemsPanelTemplate>
          <WrapPanel HorizontalAlignment="Left" IsItemsHost="True" Orientation="{Binding Orientation, RelativeSource={RelativeSource Self}}" ItemWidth="{Binding ItemWidth, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:GalleryGroupContainer}}}" ItemHeight="{Binding ItemHeight, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:GalleryGroupContainer}}}" />
        </ItemsPanelTemplate>
      </Setter.Value>
    </Setter>
    <Style.Triggers>
      <Trigger Property="Orientation" Value="Vertical">
        <Setter Property="ItemsPanel">
          <Setter.Value>
            <ItemsPanelTemplate>
              <StackPanel IsItemsHost="True" Orientation="{Binding Orientation, RelativeSource={RelativeSource Self}}" />
            </ItemsPanelTemplate>
          </Setter.Value>
        </Setter>
      </Trigger>
    </Style.Triggers>
  </Style>
  <ControlTemplate x:Key="ScrollButtonControlTemplate" TargetType="{x:Type RepeatButton}">
    <Border x:Name="border" BorderThickness="1" CornerRadius="2" BorderBrush="{StaticResource ScrollViewerButtonBorderBrush}" Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{StaticResource ScrollViewerButtonBackgroundBrush}">
      <Border x:Name="border1" Height="Auto" BorderBrush="{StaticResource TransparentBrush}" BorderThickness="1" CornerRadius="2" Background="{StaticResource TransparentBrush}">
        <Grid Height="Auto">
          <Rectangle x:Name="rectangle" StrokeThickness="0" Visibility="Collapsed">
            <Rectangle.Fill>
              <RadialGradientBrush Center="0.503,1" GradientOrigin="0.503,1" RadiusY="0.202">
                <GradientStop Color="#7FFFFFFF" Offset="0" />
                <GradientStop Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
        </Grid>
      </Border>
    </Border>
    <ControlTemplate.Triggers>
      <Trigger Property="IsMouseOver" Value="False" />
      <!--<Trigger Property="IsPressed" Value="True">
        <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource ButtonPressedOuterBorderBrush}"/>
        <Setter Property="Background" TargetName="border" Value="{DynamicResource ButtonPressedOuterBackgroundBrush}"/>
        <Setter Property="Background" TargetName="border1" Value="{DynamicResource ButtonPressedInnerBackgroundBrush}"/>
        <Setter Property="BorderBrush" TargetName="border1" Value="{DynamicResource ButtonPressedInnerBorderBrush}"/>
      </Trigger>-->
      <Trigger Property="IsEnabled" Value="False" />
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsMouseOver" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
        <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
        <Setter Property="Visibility" TargetName="rectangle" Value="Visible" />
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsKeyboardFocusWithin" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
        <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
      </MultiTrigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <Style x:Key="ScrollButtonStyle" TargetType="{x:Type RepeatButton}">
    <Setter Property="Template" Value="{StaticResource ScrollButtonControlTemplate}" />
    <Setter Property="Foreground" Value="{StaticResource DefaultFontBrush}" />
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlStyleEmptyFocus}" />
  </Style>
  <Style x:Key="RibbonScrollViewer" TargetType="{x:Type ScrollViewer}">
    <Setter Property="FocusManager.IsFocusScope" Value="False" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ScrollViewer}">
          <Grid x:Name="Grid" Background="{TemplateBinding Background}" IsHitTestVisible="True">
            <ScrollContentPresenter Margin="{TemplateBinding Padding}" x:Name="PART_ScrollContentPresenter" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" CanContentScroll="{TemplateBinding CanContentScroll}" IsHitTestVisible="True" />
            <RepeatButton Command="{x:Static ScrollBar.LineLeftCommand}" CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}" Focusable="false" HorizontalAlignment="Left" Width="13" Height="Auto" VerticalAlignment="Stretch" Style="{StaticResource ScrollButtonStyle}">
              <RepeatButton.Visibility>
                <MultiBinding FallbackValue="Visibility.Collapsed" Converter="{StaticResource MenuScrollingVisibilityConverter}" ConverterParameter="0">
                  <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="ComputedHorizontalScrollBarVisibility" />
                  <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="HorizontalOffset" />
                  <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="ExtentWidth" />
                  <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="ViewportWidth" />
                </MultiBinding>
              </RepeatButton.Visibility>
              <Path Fill="Black" Stretch="Fill" Stroke="{x:Null}" StrokeThickness="0" HorizontalAlignment="Center" Margin="0" VerticalAlignment="Center" Width="3" Height="5" Data="M0,0L1,1 1,-1z" />
            </RepeatButton>
            <RepeatButton Command="{x:Static ScrollBar.LineRightCommand}" CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}" Focusable="false" HorizontalAlignment="Right" Width="13" Height="Auto" VerticalAlignment="Stretch" Style="{StaticResource ScrollButtonStyle}">
              <RepeatButton.Visibility>
                <MultiBinding FallbackValue="Visibility.Collapsed" Converter="{StaticResource MenuScrollingVisibilityConverter}" ConverterParameter="100">
                  <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="ComputedHorizontalScrollBarVisibility" />
                  <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="HorizontalOffset" />
                  <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="ExtentWidth" />
                  <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="ViewportWidth" />
                </MultiBinding>
              </RepeatButton.Visibility>
              <Path Fill="Black" Stretch="Fill" Stroke="{x:Null}" StrokeThickness="0" HorizontalAlignment="Center" Margin="0" VerticalAlignment="Center" Width="3" Height="5" Data="M1,0L0,1 0,-1z" />
            </RepeatButton>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="CanContentScroll" Value="True" />
    <Setter Property="HorizontalScrollBarVisibility" Value="Auto" />
    <Setter Property="VerticalScrollBarVisibility" Value="Disabled" />
    <Setter Property="Focusable" Value="False" />
  </Style>
  <Style x:Key="RibbonTabScrollViewer" TargetType="{x:Type ScrollViewer}">
    <Setter Property="OverridesDefaultStyle" Value="True" />
    <Setter Property="FocusManager.IsFocusScope" Value="False" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ScrollViewer}">
          <Grid x:Name="Grid" Background="{TemplateBinding Background}" IsHitTestVisible="True">
            <ScrollContentPresenter Margin="{TemplateBinding Padding}" x:Name="PART_ScrollContentPresenter" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" CanContentScroll="{TemplateBinding CanContentScroll}" IsHitTestVisible="True" />
            <RepeatButton Command="{x:Static ScrollBar.LineLeftCommand}" CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}" Focusable="false" HorizontalAlignment="Left" Width="13" Height="Auto" VerticalAlignment="Stretch" Style="{StaticResource ScrollButtonStyle}" Margin="0,7,0,1">
              <RepeatButton.Visibility>
                <MultiBinding FallbackValue="Visibility.Collapsed" Converter="{StaticResource MenuScrollingVisibilityConverter}" ConverterParameter="0">
                  <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="ComputedHorizontalScrollBarVisibility" />
                  <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="HorizontalOffset" />
                  <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="ExtentWidth" />
                  <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="ViewportWidth" />
                </MultiBinding>
              </RepeatButton.Visibility>
              <Path Fill="Black" Stretch="Fill" Stroke="{x:Null}" StrokeThickness="0" HorizontalAlignment="Center" Margin="0" VerticalAlignment="Center" Width="3" Height="5" Data="M0,0L1,1 1,-1z" />
            </RepeatButton>
            <RepeatButton Command="{x:Static ScrollBar.LineRightCommand}" CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}" Focusable="false" HorizontalAlignment="Right" Width="13" Height="Auto" VerticalAlignment="Stretch" Style="{StaticResource ScrollButtonStyle}" Margin="0,7,0,1">
              <RepeatButton.Visibility>
                <MultiBinding FallbackValue="Visibility.Collapsed" Converter="{StaticResource MenuScrollingVisibilityConverter}" ConverterParameter="100">
                  <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="ComputedHorizontalScrollBarVisibility" />
                  <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="HorizontalOffset" />
                  <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="ExtentWidth" />
                  <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="ViewportWidth" />
                </MultiBinding>
              </RepeatButton.Visibility>
              <Path Fill="Black" Stretch="Fill" Stroke="{x:Null}" StrokeThickness="0" HorizontalAlignment="Center" Margin="0" VerticalAlignment="Center" Width="3" Height="5" Data="M1,0L0,1 0,-1z" />
            </RepeatButton>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="CanContentScroll" Value="True" />
    <Setter Property="HorizontalScrollBarVisibility" Value="Auto" />
    <Setter Property="VerticalScrollBarVisibility" Value="Disabled" />
    <Setter Property="Focusable" Value="False" />
  </Style>
  <Style x:Key="MenuScrollViewer" TargetType="{x:Type ScrollViewer}">
    <Setter Property="OverridesDefaultStyle" Value="True" />
    <Setter Property="FocusManager.IsFocusScope" Value="False" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ScrollViewer}">
          <Grid x:Name="Grid" Background="{TemplateBinding Background}" IsHitTestVisible="True">
            <ScrollContentPresenter Margin="{TemplateBinding Padding}" x:Name="PART_ScrollContentPresenter" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" CanContentScroll="{TemplateBinding CanContentScroll}" IsHitTestVisible="True" />
            <RepeatButton ClickMode="Hover" Command="{x:Static ScrollBar.LineUpCommand}" CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}" Focusable="false" HorizontalAlignment="Stretch" Width="Auto" Height="12" VerticalAlignment="Top" Style="{StaticResource ScrollButtonStyle}">
              <RepeatButton.Visibility>
                <MultiBinding FallbackValue="Visibility.Collapsed" Converter="{StaticResource MenuScrollingVisibilityConverter}" ConverterParameter="0">
                  <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="ComputedVerticalScrollBarVisibility" />
                  <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="VerticalOffset" />
                  <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="ExtentHeight" />
                  <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="ViewportHeight" />
                </MultiBinding>
              </RepeatButton.Visibility>
              <Path Stretch="Fill" Stroke="{x:Null}" StrokeThickness="0" HorizontalAlignment="Center" Margin="0" VerticalAlignment="Center" Width="5" Height="3" Data="M0,0L1,-1 2,0z">
                <Path.Fill>
                  <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <LinearGradientBrush.GradientStops>
                      <GradientStop Color="#FF1A52AD" Offset="0" />
                      <GradientStop Color="#FF0F3168" Offset="1" />
                    </LinearGradientBrush.GradientStops>
                  </LinearGradientBrush>
                </Path.Fill>
              </Path>
            </RepeatButton>
            <RepeatButton ClickMode="Hover" Command="{x:Static ScrollBar.LineDownCommand}" CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}" Focusable="false" HorizontalAlignment="Stretch" Width="Auto" Height="12" VerticalAlignment="Bottom" Style="{StaticResource ScrollButtonStyle}">
              <RepeatButton.Visibility>
                <MultiBinding FallbackValue="Visibility.Collapsed" Converter="{StaticResource MenuScrollingVisibilityConverter}" ConverterParameter="100">
                  <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="ComputedVerticalScrollBarVisibility" />
                  <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="VerticalOffset" />
                  <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="ExtentHeight" />
                  <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="ViewportHeight" />
                </MultiBinding>
              </RepeatButton.Visibility>
              <Path Stretch="Fill" Stroke="{x:Null}" StrokeThickness="0" HorizontalAlignment="Center" Margin="0" VerticalAlignment="Center" Width="5" Height="3" Data="M0,0L1,1 2,0z">
                <Path.Fill>
                  <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <LinearGradientBrush.GradientStops>
                      <GradientStop Color="#FF1A52AD" Offset="0" />
                      <GradientStop Color="#FF0F3168" Offset="1" />
                    </LinearGradientBrush.GradientStops>
                  </LinearGradientBrush>
                </Path.Fill>
              </Path>
            </RepeatButton>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="CanContentScroll" Value="True" />
    <Setter Property="HorizontalScrollBarVisibility" Value="Auto" />
    <Setter Property="VerticalScrollBarVisibility" Value="Disabled" />
    <Setter Property="Focusable" Value="False" />
  </Style>
  <ControlTemplate x:Key="ScrollViewerControlTemplate" TargetType="{x:Type ScrollViewer}">
    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
      <Grid x:Name="Grid" Background="{TemplateBinding Background}">
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="*" />
          <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
          <RowDefinition Height="*" />
          <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Rectangle x:Name="Corner" Grid.Column="1" Fill="{StaticResource {x:Static SystemColors.ControlBrushKey}}" Grid.Row="1" />
        <ScrollContentPresenter x:Name="PART_ScrollContentPresenter" CanContentScroll="{TemplateBinding CanContentScroll}" CanHorizontallyScroll="False" CanVerticallyScroll="False" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="0" Margin="{TemplateBinding Padding}" Grid.Row="0" />
        <ScrollBar x:Name="PART_VerticalScrollBar" AutomationProperties.AutomationId="VerticalScrollBar" Cursor="Arrow" Grid.Column="1" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" Grid.Row="0" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}" />
        <ScrollBar x:Name="PART_HorizontalScrollBar" AutomationProperties.AutomationId="HorizontalScrollBar" Cursor="Arrow" Grid.Column="0" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" Orientation="Horizontal" Grid.Row="1" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}" />
      </Grid>
    </Border>
  </ControlTemplate>
  <ControlTemplate x:Key="RibbonContextualTabGroupControlTemplate1" TargetType="{x:Type Fluent:RibbonContextualTabGroup}">
    <Border x:Name="rootBorder" Visibility="{TemplateBinding InnerVisibility}" Margin="2,0,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Top" Width="Auto" Height="25" BorderThickness="1,0" Background="{StaticResource TransparentBrush}">
      <Border.BorderBrush>
        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
          <GradientStop Color="#F2FFFFFF" Offset="0" />
          <GradientStop Color="#CCFFFFFF" Offset="1" />
        </LinearGradientBrush>
      </Border.BorderBrush>
      <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,0" Background="{x:Null}" Margin="0,0,0,-25" VerticalAlignment="Top" Height="25">
        <Grid Margin="0" VerticalAlignment="Top" Height="25">
          <Rectangle Fill="{TemplateBinding Background}" Stroke="{x:Null}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="Auto" StrokeThickness="0">
            <Rectangle.OpacityMask>
              <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="Black" Offset="0" />
                <GradientStop Color="#59000000" Offset="1" />
                <GradientStop Color="Black" Offset="0.16" />
                <GradientStop Color="#99000000" Offset="0.161" />
              </LinearGradientBrush>
            </Rectangle.OpacityMask>
          </Rectangle>
          <Rectangle Stroke="{x:Null}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="Auto" Fill="#3FD2D2D2">
            <Rectangle.OpacityMask>
              <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="Black" Offset="0" />
                <GradientStop Color="#7F000000" Offset="1" />
                <GradientStop Color="Black" Offset="0.16" />
                <GradientStop Color="#B2000000" Offset="0.161" />
              </LinearGradientBrush>
            </Rectangle.OpacityMask>
          </Rectangle>
          <TextBlock Text="{TemplateBinding Header}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="5,0" TextTrimming="None" Foreground="#00000000" FontWeight="Bold" />
          <TextBlock Text="{TemplateBinding Header}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="5,0" TextTrimming="CharacterEllipsis" FontWeight="Bold">
            <TextBlock.Effect>
              <BlurEffect Radius="2" />
            </TextBlock.Effect>
          </TextBlock>
          <TextBlock Text="{TemplateBinding Header}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="5,0" TextTrimming="CharacterEllipsis" Foreground="White" FontWeight="Bold" />
        </Grid>
      </Border>
    </Border>
    <ControlTemplate.Triggers>
      <Trigger Property="IsWindowMaximized" Value="True">
        <Setter Property="Margin" TargetName="rootBorder" Value="2,2,0,-0.1" />
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <Style x:Key="RibbonTitleBarStyle" TargetType="{x:Type Fluent:RibbonTitleBar}">
    <Setter Property="Template" Value="{StaticResource RibbonTitleBarControlTemplate}" />
    <Setter Property="Focusable" Value="False" />
    <Setter Property="FocusManager.IsFocusScope" Value="False" />
  </Style>
  <Style x:Key="KeyTipStyle" TargetType="Fluent:KeyTip">
    <Style.Triggers>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="Opacity" Value="0.5" />
      </Trigger>
    </Style.Triggers>
    <Setter Property="Foreground" Value="{StaticResource DefaultFontBrush}" />
    <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}" />
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="Fluent:KeyTip">
          <Grid>
            <Border CornerRadius="2" BorderThickness="1" BorderBrush="{StaticResource KeyTipBorderBrush}" Background="{StaticResource KeyTipBackgroundBrush}">
              <TextBlock Text="{TemplateBinding Content}" TextWrapping="Wrap" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="4,-1,4,1" />
            </Border>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <ControlTemplate x:Key="ToolbarDropDownButtonControlTemplate" TargetType="{x:Type Fluent:DropDownButton}">
    <Grid>
      <Border x:Name="PART_ButtonBorder" BorderThickness="1" CornerRadius="2" Background="{StaticResource TransparentBrush}" BorderBrush="{StaticResource TransparentBrush}" Height="22" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="13">
        <Border x:Name="border1" Height="Auto" BorderBrush="{StaticResource TransparentBrush}" BorderThickness="1" CornerRadius="2" Background="{StaticResource TransparentBrush}">
          <Grid x:Name="grid" Margin="0" Background="#00000000">
            <Rectangle x:Name="rectangle" StrokeThickness="0" Visibility="Collapsed" Margin="0">
              <Rectangle.Fill>
                <RadialGradientBrush Center="0.503,1" GradientOrigin="0.503,1" RadiusY="0.202">
                  <GradientStop Color="#7FFFFFFF" Offset="0" />
                  <GradientStop Offset="1" />
                </RadialGradientBrush>
              </Rectangle.Fill>
            </Rectangle>
            <StackPanel x:Name="stackPanel" Width="Auto" Orientation="Horizontal" VerticalAlignment="Top" Margin="-1,4,0,0" Background="#00000000">
              <Image x:Name="iconImage" HorizontalAlignment="Left" Height="8" Stretch="None" VerticalAlignment="Top" Source="{TemplateBinding LargeIcon}" Width="8" Margin="-3,0,2,0" />
            </StackPanel>
          </Grid>
        </Border>
      </Border>
      <Popup x:Name="PART_Popup" Placement="Bottom" IsOpen="{TemplateBinding IsDropDownOpen}" AllowsTransparency="True" Focusable="False" PopupAnimation="Fade" Margin="0,0,-4,0" VerticalAlignment="Top" Grid.ColumnSpan="2">
        <Grid Name="DropDown" SnapsToDevicePixels="True" Margin="0" VerticalAlignment="Top">
          <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="10" />
          </Grid.RowDefinitions>
          <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="10" />
          </Grid.ColumnDefinitions>
          <Rectangle HorizontalAlignment="Left" VerticalAlignment="Top" Width="4" Height="4" Grid.Row="1" Grid.Column="1" StrokeThickness="0" Margin="-1,-1,0,0">
            <Rectangle.Fill>
              <RadialGradientBrush RadiusX="0.984" Center="0.017,0.002" GradientOrigin="0.017,0.002" RadiusY="1">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="-1,3,0,0" VerticalAlignment="Top" Width="4" Height="4" Grid.Column="1" Grid.Row="0">
            <Rectangle.Fill>
              <RadialGradientBrush Center="0.032,1.01" GradientOrigin="0.032,1.01" RadiusX="0.984" RadiusY="1">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="3,-1,0,0" VerticalAlignment="Top" Width="4" Height="4" Grid.Column="0" Grid.Row="1">
            <Rectangle.Fill>
              <RadialGradientBrush Center="0.996,0.027" GradientOrigin="0.996,0.027" RadiusX="0.984" RadiusY="1">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Stretch" Margin="7,-1,1,0" VerticalAlignment="Top" Width="Auto" Height="4" Grid.Column="0" Grid.Row="1">
            <Rectangle.Fill>
              <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" MappingMode="RelativeToBoundingBox">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </LinearGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="-1,7,0,1" VerticalAlignment="Stretch" Width="4" Height="Auto" Grid.Column="1" Grid.Row="0">
            <Rectangle.Fill>
              <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5" MappingMode="RelativeToBoundingBox">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </LinearGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Border x:Name="PART_DropDownBorder" MinWidth="{TemplateBinding ActualWidth}" SnapsToDevicePixels="True" Background="{StaticResource ContextMenuBarBackgroundBrush}" BorderBrush="{StaticResource ContextMenuBarBorderBrush}" BorderThickness="1" CornerRadius="1" Grid.ColumnSpan="1" HorizontalAlignment="Stretch" VerticalAlignment="Top">
            <Grid Width="Auto" Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Top">
              <Border VerticalAlignment="Top" Width="Auto" Height="Auto" BorderBrush="{StaticResource ContextMenuBarBackgroundBrush}" BorderThickness="1" CornerRadius="1" />
              <Grid Margin="1" HorizontalAlignment="Stretch" VerticalAlignment="Top">
                <Grid.RowDefinitions>
                  <RowDefinition Height="*" />
                  <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Rectangle Fill="{x:Null}" Stretch="Fill" Stroke="#FFE2E4E7" HorizontalAlignment="Left" Margin="24,0,0,0" Width="1" Height="Auto" Grid.RowSpan="2" Visibility="Visible" VerticalAlignment="Stretch" />
                <ScrollViewer Margin="1" MaxHeight="{TemplateBinding MaxDropDownHeight}" SnapsToDevicePixels="True" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Hidden">
                  <Fluent:MenuPanel x:Name="PART_MenuPanel" IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle" />
                </ScrollViewer>
                <Border x:Name="resizeBorder" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="11" BorderBrush="{StaticResource ContextMenuBarResizeBorderBrush}" BorderThickness="0,1,0,0" Grid.Row="1" CornerRadius="0,0,1,1" Background="{StaticResource ContextMenuBarResizeBackgoundBrush}">
                  <Grid>
                    <Thumb x:Name="PART_ResizeVerticalThumb" HorizontalAlignment="Stretch" Margin="0,0,0,-90" Width="Auto" Height="10" VerticalAlignment="Top" Cursor="SizeNS" Template="{StaticResource ResizeVerticalThumbControlTemplate}" />
                    <Thumb x:Name="PART_ResizeBothThumb" HorizontalAlignment="Right" Margin="0,0,0,-90" Width="10" Height="10" VerticalAlignment="Top" Cursor="SizeNWSE" Template="{StaticResource ResizeBothThumbControlTemplate}" />
                  </Grid>
                </Border>
              </Grid>
            </Grid>
          </Border>
        </Grid>
      </Popup>
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="ResizeMode" Value="None">
        <Setter Property="Visibility" TargetName="resizeBorder" Value="Collapsed" />
      </Trigger>
      <Trigger Property="ResizeMode" Value="Both">
        <Setter Property="Visibility" TargetName="PART_ResizeVerticalThumb" Value="Collapsed" />
        <Setter Property="Visibility" TargetName="PART_ResizeBothThumb" Value="Visible" />
        <Setter Property="Visibility" TargetName="resizeBorder" Value="Visible" />
      </Trigger>
      <Trigger Property="ResizeMode" Value="Vertical">
        <Setter Property="Visibility" TargetName="PART_ResizeBothThumb" Value="Collapsed" />
        <Setter Property="Visibility" TargetName="PART_ResizeVerticalThumb" Value="Visible" />
        <Setter Property="Visibility" TargetName="resizeBorder" Value="Visible" />
      </Trigger>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="Opacity" TargetName="iconImage" Value="0.25" />
      </Trigger>
      <Trigger Property="Size" Value="Small">
        <Setter Property="Orientation" TargetName="stackPanel" Value="Horizontal" />
        <Setter Property="Source" TargetName="iconImage" Value="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}}" />
        <Setter Property="Width" TargetName="iconImage" Value="16" />
        <Setter Property="Height" TargetName="iconImage" Value="16" />
        <Setter Property="Margin" TargetName="iconImage" Value="2" />
        <Setter Property="Margin" TargetName="grid" Value="0" />
      </Trigger>
      <Trigger Property="Size" Value="Middle">
        <Setter Property="Orientation" TargetName="stackPanel" Value="Horizontal" />
        <Setter Property="Source" TargetName="iconImage" Value="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}}" />
        <Setter Property="Width" TargetName="stackPanel" Value="Auto" />
        <Setter Property="VerticalAlignment" TargetName="iconImage" Value="Center" />
        <Setter Property="VerticalAlignment" TargetName="PART_ButtonBorder" Value="Stretch" />
        <Setter Property="Width" TargetName="iconImage" Value="16" />
        <Setter Property="Height" TargetName="iconImage" Value="16" />
        <Setter Property="Margin" TargetName="iconImage" Value="2" />
      </Trigger>
      <Trigger Property="IsDropDownOpen" Value="True">
        <Setter Property="BorderBrush" TargetName="PART_ButtonBorder" Value="{StaticResource ButtonPressedOuterBorderBrush}" />
        <Setter Property="Background" TargetName="PART_ButtonBorder" Value="{StaticResource ButtonPressedOuterBackgroundBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonPressedInnerBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonPressedInnerBorderBrush}" />
      </Trigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsMouseOver" Value="True" />
          <Condition Property="IsDropDownOpen" Value="False" />
        </MultiTrigger.Conditions>
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
        <Setter Property="Background" TargetName="PART_ButtonBorder" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="PART_ButtonBorder" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
        <Setter Property="Visibility" TargetName="rectangle" Value="Visible" />
        <Setter Property="Margin" TargetName="rectangle" Value="0" />
        <Setter Property="Margin" TargetName="grid" Value="0" />
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsFocused" Value="True" />
          <Condition Property="IsDropDownOpen" Value="False" />
        </MultiTrigger.Conditions>
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
        <Setter Property="Background" TargetName="PART_ButtonBorder" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="PART_ButtonBorder" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
        <Setter Property="Visibility" TargetName="rectangle" Value="Visible" />
      </MultiTrigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <ControlTemplate x:Key="MenuItemTemplate" TargetType="{x:Type MenuItem}">
    <ControlTemplate.Resources>
      <ResourceDictionary>
        <Style x:Key="{x:Type ScrollViewer}" TargetType="{x:Type ScrollViewer}" BasedOn="{StaticResource MenuScrollViewer}" />
      </ResourceDictionary>
    </ControlTemplate.Resources>
    <Grid Width="Auto" Height="22" Background="#00000000">
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="25" />
        <ColumnDefinition Width="*" />
        <ColumnDefinition Width="Auto" />
      </Grid.ColumnDefinitions>
      <Border x:Name="border" HorizontalAlignment="Stretch" Margin="0" Width="Auto" Visibility="Collapsed" Background="{StaticResource ButtonHoverOuterBackgroundBrush}" BorderBrush="{StaticResource ButtonHoverOuterBorderBrush}" BorderThickness="1" CornerRadius="2" Grid.Column="0" Grid.ColumnSpan="3">
        <Border Background="{StaticResource ButtonHoverInnerBackgroundBrush}" BorderBrush="{StaticResource ButtonHoverInnerBorderBrush}" BorderThickness="1" CornerRadius="1" />
      </Border>
      <TextBlock x:Name="textBlock_Copy" Text="{TemplateBinding Header}" Width="Auto" Height="Auto" Margin="9,3,13,3" VerticalAlignment="Center" Grid.Column="1" TextTrimming="None" d:LayoutOverrides="Width" Visibility="Hidden" HorizontalAlignment="Left" />
      <ContentPresenter x:Name="textBlock" ContentSource="Header" Width="Auto" Height="Auto" Margin="9,3,3,3" VerticalAlignment="Center" Grid.Column="1" d:LayoutOverrides="Width" RecognizesAccessKey="True" />
      <Rectangle x:Name="rectangle" Fill="{StaticResource MenuItemCheckBoxBackgroundBrush}" Stroke="{StaticResource MenuItemCheckBoxBorderBrush}" Grid.ColumnSpan="1" HorizontalAlignment="Center" VerticalAlignment="Center" Width="20" Height="20" RadiusX="1" RadiusY="1" Visibility="Collapsed" />
      <Image x:Name="image" HorizontalAlignment="Center" VerticalAlignment="Center" Source="/Fluent;Component/Themes/Office2010/Images/Checked.png" Stretch="None" Visibility="Collapsed" SnapsToDevicePixels="True" />
      <ContentPresenter x:Name="iconImage" HorizontalAlignment="Center" Height="16" VerticalAlignment="Center" Content="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource StringToImageConvert}}" Width="16" Margin="3,2,2,2" SnapsToDevicePixels="True" />
      <TextBlock x:Name="gestureTextBlock" Text="{TemplateBinding InputGestureText}" Width="Auto" Height="Auto" Margin="3,3,15,3" VerticalAlignment="Center" Grid.Column="2" />
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="InputGestureText" Value="{x:Null}">
        <Setter Property="Visibility" TargetName="gestureTextBlock" Value="Collapsed" />
      </Trigger>
      <Trigger Property="InputGestureText" Value="">
        <Setter Property="Visibility" TargetName="gestureTextBlock" Value="Collapsed" />
      </Trigger>
      <Trigger Property="IsChecked" Value="True">
        <Setter Property="Visibility" TargetName="rectangle" Value="Visible" />
      </Trigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="Icon" Value="{x:Null}" />
          <Condition Property="IsChecked" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="Visibility" TargetName="image" Value="Visible" />
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsHighlighted" Value="True" />
          <Condition Property="IsEnabled" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="Visibility" TargetName="border" Value="Visible" />
      </MultiTrigger>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="Opacity" TargetName="iconImage" Value="0.5" />
        <Setter Property="Opacity" TargetName="image" Value="0.5" />
        <Setter Property="Opacity" TargetName="textBlock" Value="0.5" />
        <Setter Property="Opacity" TargetName="gestureTextBlock" Value="0.5" />
        <Setter Property="Effect" TargetName="iconImage">
          <Setter.Value>
            <Fluent:GrayscaleEffect />
          </Setter.Value>
        </Setter>
        <Setter Property="Effect" TargetName="image">
          <Setter.Value>
            <Fluent:GrayscaleEffect />
          </Setter.Value>
        </Setter>
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <ControlTemplate x:Key="HeaderMenuItemTemplate" TargetType="{x:Type MenuItem}">
    <ControlTemplate.Resources>
      <ResourceDictionary>
        <Style x:Key="{x:Type ScrollViewer}" TargetType="{x:Type ScrollViewer}" BasedOn="{StaticResource MenuScrollViewer}" />
      </ResourceDictionary>
    </ControlTemplate.Resources>
    <Grid Width="Auto" Height="22" Background="#00000000">
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="25" />
        <ColumnDefinition Width="*" />
        <ColumnDefinition Width="Auto" />
      </Grid.ColumnDefinitions>
      <Border x:Name="border" HorizontalAlignment="Stretch" Margin="0" Width="Auto" Visibility="Collapsed" Background="{StaticResource ButtonHoverOuterBackgroundBrush}" BorderBrush="{StaticResource ButtonHoverOuterBorderBrush}" BorderThickness="1" CornerRadius="2" Grid.Column="0" Grid.ColumnSpan="3">
        <Border Background="{StaticResource ButtonHoverInnerBackgroundBrush}" BorderBrush="{StaticResource ButtonHoverInnerBorderBrush}" BorderThickness="1" CornerRadius="1" />
      </Border>
      <TextBlock x:Name="textBlock_Copy" Text="{TemplateBinding Header}" Width="Auto" Height="Auto" Margin="9,3,13,3" VerticalAlignment="Center" Grid.Column="1" TextTrimming="None" d:LayoutOverrides="Width" Visibility="Hidden" HorizontalAlignment="Left" />
      <ContentPresenter x:Name="textBlock" ContentSource="Header" Width="Auto" Height="Auto" Margin="9,3,3,3" VerticalAlignment="Center" Grid.Column="1" d:LayoutOverrides="Width" RecognizesAccessKey="True" />
      <Rectangle x:Name="rectangle" Fill="{StaticResource MenuItemCheckBoxBackgroundBrush}" Stroke="{StaticResource MenuItemCheckBoxBorderBrush}" Grid.ColumnSpan="1" HorizontalAlignment="Center" VerticalAlignment="Center" Width="20" Height="20" RadiusX="1" RadiusY="1" Visibility="Collapsed" />
      <Image x:Name="image" HorizontalAlignment="Center" VerticalAlignment="Center" Source="/Fluent;Component/Themes/Office2010/Images/Checked.png" Stretch="None" Visibility="Collapsed" SnapsToDevicePixels="True" />
      <ContentPresenter x:Name="iconImage" HorizontalAlignment="Center" Height="16" VerticalAlignment="Center" Content="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource StringToImageConvert}}" Width="16" Margin="3,2,2,2" SnapsToDevicePixels="True" RecognizesAccessKey="True" />
      <Path x:Name="path" Stretch="Fill" Stroke="{x:Null}" HorizontalAlignment="Right" Margin="1,0,9,0" Width="4" Data="M0,0L1,1 0,2z" Height="7" Grid.Column="3">
        <Path.Fill>
          <LinearGradientBrush EndPoint="0.945,0.872" StartPoint="0.055,0.128">
            <GradientStop Color="#FF7C7C7C" Offset="1" />
            <GradientStop Color="#FF9E9E9E" />
          </LinearGradientBrush>
        </Path.Fill>
      </Path>
      <Popup x:Name="PART_Popup" Placement="Right" IsOpen="{TemplateBinding IsSubmenuOpen}" AllowsTransparency="True" Focusable="False" PopupAnimation="Fade" Margin="0,0,-4,0" VerticalAlignment="Top" Grid.ColumnSpan="2">
        <Grid Name="DropDown" SnapsToDevicePixels="True" Margin="0" VerticalAlignment="Stretch">
          <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="10" />
          </Grid.RowDefinitions>
          <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="10" />
          </Grid.ColumnDefinitions>
          <Rectangle HorizontalAlignment="Left" VerticalAlignment="Top" Width="4" Height="4" Grid.Row="1" Grid.Column="1" StrokeThickness="0" Margin="-1,-1,0,0">
            <Rectangle.Fill>
              <RadialGradientBrush RadiusX="0.984" Center="0.017,0.002" GradientOrigin="0.017,0.002" RadiusY="1">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="-1,3,0,0" VerticalAlignment="Top" Width="4" Height="4" Grid.Column="1" Grid.Row="0">
            <Rectangle.Fill>
              <RadialGradientBrush Center="0.032,1.01" GradientOrigin="0.032,1.01" RadiusX="0.984" RadiusY="1">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="3,-1,0,0" VerticalAlignment="Top" Width="4" Height="4" Grid.Column="0" Grid.Row="1">
            <Rectangle.Fill>
              <RadialGradientBrush Center="0.996,0.027" GradientOrigin="0.996,0.027" RadiusX="0.984" RadiusY="1">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Stretch" Margin="7,-1,1,0" VerticalAlignment="Top" Width="Auto" Height="4" Grid.Column="0" Grid.Row="1">
            <Rectangle.Fill>
              <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" MappingMode="RelativeToBoundingBox">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </LinearGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="-1,7,0,1" VerticalAlignment="Stretch" Width="4" Height="Auto" Grid.Column="1" Grid.Row="0">
            <Rectangle.Fill>
              <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5" MappingMode="RelativeToBoundingBox">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </LinearGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Border x:Name="DropDownBorder" SnapsToDevicePixels="True" Background="{StaticResource ContextMenuBarBackgroundBrush}" BorderBrush="{StaticResource ContextMenuBarBorderBrush}" BorderThickness="1" CornerRadius="1" Grid.ColumnSpan="1" d:LayoutOverrides="Width, Height" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
            <Grid Width="Auto" Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
              <Border VerticalAlignment="Stretch" Width="Auto" Height="Auto" BorderBrush="{StaticResource ContextMenuBarBackgroundBrush}" BorderThickness="1" CornerRadius="1" />
              <Grid Margin="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                <Grid.RowDefinitions>
                  <RowDefinition Height="*" />
                  <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Path Fill="{x:Null}" Stretch="Fill" Stroke="#FFE2E4E7" HorizontalAlignment="Left" Margin="24,0,0,0" Width="1" Height="Auto" Data="M0,0L0,1" Grid.RowSpan="2" Visibility="Visible" />
                <ScrollViewer x:Name="PART_ScrollViewer" Style="{StaticResource MenuScrollViewer}" Margin="1" SnapsToDevicePixels="True">
                  <Fluent:MenuPanel x:Name="PART_MenuPanel" IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" />
                </ScrollViewer>
                <Border x:Name="resizeBorder" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="11" BorderBrush="{StaticResource ContextMenuBarResizeBorderBrush}" BorderThickness="0,1,0,0" Grid.Row="1" CornerRadius="0,0,1,1" Background="{StaticResource ContextMenuBarResizeBackgoundBrush}">
                  <Grid>
                    <Thumb x:Name="PART_ResizeVerticalThumb" HorizontalAlignment="Stretch" Margin="0,0,0,-90" Width="Auto" Height="10" VerticalAlignment="Top" Cursor="SizeNS" Template="{StaticResource ResizeVerticalThumbControlTemplate}" />
                    <Thumb x:Name="PART_ResizeBothThumb" HorizontalAlignment="Right" Margin="0,0,0,-90" Width="10" Height="10" VerticalAlignment="Top" Cursor="SizeNWSE" Template="{StaticResource ResizeBothThumbControlTemplate}" />
                  </Grid>
                </Border>
              </Grid>
            </Grid>
          </Border>
        </Grid>
      </Popup>
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="Fluent:MenuItem.ResizeMode" Value="None">
        <Setter Property="Visibility" TargetName="resizeBorder" Value="Collapsed" />
      </Trigger>
      <Trigger Property="Fluent:MenuItem.ResizeMode" Value="Both">
        <Setter Property="Visibility" TargetName="PART_ResizeVerticalThumb" Value="Collapsed" />
        <Setter Property="Visibility" TargetName="PART_ResizeBothThumb" Value="Visible" />
        <Setter Property="Visibility" TargetName="resizeBorder" Value="Visible" />
      </Trigger>
      <Trigger Property="Fluent:MenuItem.ResizeMode" Value="Vertical">
        <Setter Property="Visibility" TargetName="PART_ResizeBothThumb" Value="Collapsed" />
        <Setter Property="Visibility" TargetName="PART_ResizeVerticalThumb" Value="Visible" />
        <Setter Property="Visibility" TargetName="resizeBorder" Value="Visible" />
      </Trigger>
      <Trigger Property="IsChecked" Value="True">
        <Setter Property="Visibility" TargetName="rectangle" Value="Visible" />
      </Trigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="Icon" Value="{x:Null}" />
          <Condition Property="IsChecked" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="Visibility" TargetName="image" Value="Visible" />
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsHighlighted" Value="True" />
          <Condition Property="IsEnabled" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="Visibility" TargetName="border" Value="Visible" />
      </MultiTrigger>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="Opacity" TargetName="iconImage" Value="0.5" />
        <Setter Property="Opacity" TargetName="image" Value="0.5" />
        <Setter Property="Opacity" TargetName="textBlock" Value="0.5" />
        <Setter Property="Effect" TargetName="iconImage">
          <Setter.Value>
            <Fluent:GrayscaleEffect />
          </Setter.Value>
        </Setter>
        <Setter Property="Effect" TargetName="image">
          <Setter.Value>
            <Fluent:GrayscaleEffect />
          </Setter.Value>
        </Setter>
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <ControlTemplate x:Key="SplitedMenuItemTemplate" TargetType="{x:Type MenuItem}">
    <ControlTemplate.Resources>
      <ResourceDictionary>
        <Style x:Key="{x:Type ScrollViewer}" TargetType="{x:Type ScrollViewer}" BasedOn="{StaticResource MenuScrollViewer}" />
      </ResourceDictionary>
    </ControlTemplate.Resources>
    <Grid Width="Auto" Height="22" Background="#00000000">
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="25" />
        <ColumnDefinition Width="*" />
        <ColumnDefinition Width="Auto" />
      </Grid.ColumnDefinitions>
      <Rectangle Grid.Column="2" HorizontalAlignment="Right" Margin="0,4,23,4" Stroke="{StaticResource WindowContentBorderBrush}" Width="1" />
      <Grid HorizontalAlignment="Stretch" Margin="0" Width="Auto" Grid.Column="0" Grid.ColumnSpan="3">
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="0.905*" />
          <ColumnDefinition x:Name="columnDefinition" Width="23" />
        </Grid.ColumnDefinitions>
        <Border x:Name="PART_ButtonBorder" Visibility="Collapsed" Background="{StaticResource ButtonHoverOuterBackgroundBrush}" BorderBrush="{StaticResource ButtonHoverOuterBorderBrush}" BorderThickness="1" CornerRadius="2" Margin="0,0,-1,0">
          <Border x:Name="border1" Background="{StaticResource ButtonHoverInnerBackgroundBrush}" BorderBrush="{StaticResource ButtonHoverInnerBorderBrush}" BorderThickness="1" CornerRadius="1" Grid.ColumnSpan="2" />
        </Border>
        <Border x:Name="border_Copy" HorizontalAlignment="Stretch" Margin="0" Width="Auto" Visibility="Collapsed" BorderBrush="{StaticResource ButtonHoverOuterBorderBrush}" BorderThickness="1" CornerRadius="2" Grid.Column="1" Background="{StaticResource TransparentBrush}">
          <Border x:Name="border1_Copy" Background="{StaticResource ButtonHoverInnerBackgroundBrush}" BorderBrush="{StaticResource ButtonHoverInnerBorderBrush}" BorderThickness="1" CornerRadius="1" Grid.ColumnSpan="1" d:CopyToken="09a4b798-0b8a-441e-b6c8-d7787f8d7e43" Visibility="Collapsed" />
        </Border>
      </Grid>
      <TextBlock x:Name="textBlock_Copy" Text="{TemplateBinding Header}" Width="Auto" Height="Auto" Margin="9,3,13,3" VerticalAlignment="Center" Grid.Column="1" TextTrimming="None" d:LayoutOverrides="Width" Visibility="Hidden" HorizontalAlignment="Left" />
      <ContentPresenter x:Name="textBlock" ContentSource="Header" Width="Auto" Height="Auto" Margin="9,3,3,3" VerticalAlignment="Center" Grid.Column="1" d:LayoutOverrides="Width" RecognizesAccessKey="True" />
      <Rectangle x:Name="rectangle" Fill="{StaticResource MenuItemCheckBoxBackgroundBrush}" Stroke="{StaticResource MenuItemCheckBoxBorderBrush}" Grid.ColumnSpan="1" HorizontalAlignment="Center" VerticalAlignment="Center" Width="20" Height="20" RadiusX="1" RadiusY="1" Visibility="Collapsed" />
      <Image x:Name="image" HorizontalAlignment="Center" VerticalAlignment="Center" Source="/Fluent;Component/Themes/Office2010/Images/Checked.png" Stretch="None" Visibility="Collapsed" SnapsToDevicePixels="True" />
      <ContentPresenter x:Name="iconImage" HorizontalAlignment="Center" Height="16" VerticalAlignment="Center" Content="{Binding Icon, Converter={StaticResource StringToImageConvert}, RelativeSource={RelativeSource TemplatedParent}}" Width="16" Margin="3,2,2,2" SnapsToDevicePixels="True" RecognizesAccessKey="True" />
      <Path x:Name="path" Stretch="Fill" Stroke="{x:Null}" HorizontalAlignment="Right" Margin="1,0,9,0" Width="4" Data="M0,0L1,1 0,2z" Height="7" Grid.Column="3">
        <Path.Fill>
          <LinearGradientBrush EndPoint="0.945,0.872" StartPoint="0.055,0.128">
            <GradientStop Color="#FF7C7C7C" Offset="1" />
            <GradientStop Color="#FF9E9E9E" />
          </LinearGradientBrush>
        </Path.Fill>
      </Path>
      <Popup x:Name="PART_Popup" Placement="Right" IsOpen="{TemplateBinding IsSubmenuOpen}" AllowsTransparency="True" Focusable="False" PopupAnimation="Fade" Margin="0,0,-4,0" VerticalAlignment="Top" Grid.ColumnSpan="2">
        <Grid x:Name="DropDown" SnapsToDevicePixels="True" Margin="0" VerticalAlignment="Stretch">
          <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="10" />
          </Grid.RowDefinitions>
          <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="10" />
          </Grid.ColumnDefinitions>
          <Rectangle HorizontalAlignment="Left" VerticalAlignment="Top" Width="4" Height="4" Grid.Row="1" Grid.Column="1" StrokeThickness="0" Margin="-1,-1,0,0">
            <Rectangle.Fill>
              <RadialGradientBrush RadiusX="0.984" Center="0.017,0.002" GradientOrigin="0.017,0.002" RadiusY="1">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="-1,3,0,0" VerticalAlignment="Top" Width="4" Height="4" Grid.Column="1" Grid.Row="0">
            <Rectangle.Fill>
              <RadialGradientBrush Center="0.032,1.01" GradientOrigin="0.032,1.01" RadiusX="0.984" RadiusY="1">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="3,-1,0,0" VerticalAlignment="Top" Width="4" Height="4" Grid.Column="0" Grid.Row="1">
            <Rectangle.Fill>
              <RadialGradientBrush Center="0.996,0.027" GradientOrigin="0.996,0.027" RadiusX="0.984" RadiusY="1">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Stretch" Margin="7,-1,1,0" VerticalAlignment="Top" Width="Auto" Height="4" Grid.Column="0" Grid.Row="1">
            <Rectangle.Fill>
              <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" MappingMode="RelativeToBoundingBox">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </LinearGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="-1,7,0,1" VerticalAlignment="Stretch" Width="4" Height="Auto" Grid.Column="1" Grid.Row="0">
            <Rectangle.Fill>
              <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5" MappingMode="RelativeToBoundingBox">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </LinearGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Border x:Name="DropDownBorder" SnapsToDevicePixels="True" Background="{StaticResource ContextMenuBarBackgroundBrush}" BorderBrush="{StaticResource ContextMenuBarBorderBrush}" BorderThickness="1" CornerRadius="1" Grid.ColumnSpan="1" d:LayoutOverrides="Width, Height" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
            <Grid Width="Auto" Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
              <Border VerticalAlignment="Stretch" Width="Auto" Height="Auto" BorderBrush="{StaticResource ContextMenuBarBackgroundBrush}" BorderThickness="1" CornerRadius="1" />
              <Grid Margin="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                <Grid.RowDefinitions>
                  <RowDefinition Height="*" />
                  <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Path Fill="{x:Null}" Stretch="Fill" Stroke="#FFE2E4E7" HorizontalAlignment="Left" Margin="24,0,0,0" Width="1" Height="Auto" Data="M0,0L0,1" Grid.RowSpan="2" Visibility="Visible" />
                <ScrollViewer Margin="1" x:Name="PART_ScrollViewer" Style="{StaticResource MenuScrollViewer}" SnapsToDevicePixels="True">
                  <Fluent:MenuPanel x:Name="PART_MenuPanel" IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" />
                </ScrollViewer>
                <Border x:Name="resizeBorder" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="11" BorderBrush="{StaticResource ContextMenuBarResizeBorderBrush}" BorderThickness="0,1,0,0" Grid.Row="1" CornerRadius="0,0,1,1" Background="{StaticResource ContextMenuBarResizeBackgoundBrush}">
                  <Grid>
                    <Thumb x:Name="PART_ResizeVerticalThumb" HorizontalAlignment="Stretch" Margin="0,0,0,-90" Width="Auto" Height="10" VerticalAlignment="Top" Cursor="SizeNS" Template="{StaticResource ResizeVerticalThumbControlTemplate}" />
                    <Thumb x:Name="PART_ResizeBothThumb" HorizontalAlignment="Right" Margin="0,0,0,-90" Width="10" Height="10" VerticalAlignment="Top" Cursor="SizeNWSE" Template="{StaticResource ResizeBothThumbControlTemplate}" />
                  </Grid>
                </Border>
              </Grid>
            </Grid>
          </Border>
        </Grid>
      </Popup>
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="IsMouseOver" Value="True" SourceName="border_Copy">
        <Setter Property="Visibility" TargetName="border1_Copy" Value="Visible" />
      </Trigger>
      <Trigger Property="Fluent:MenuItem.ResizeMode" Value="None">
        <Setter Property="Visibility" TargetName="resizeBorder" Value="Collapsed" />
      </Trigger>
      <Trigger Property="Fluent:MenuItem.ResizeMode" Value="Both">
        <Setter Property="Visibility" TargetName="PART_ResizeVerticalThumb" Value="Collapsed" />
        <Setter Property="Visibility" TargetName="PART_ResizeBothThumb" Value="Visible" />
        <Setter Property="Visibility" TargetName="resizeBorder" Value="Visible" />
      </Trigger>
      <Trigger Property="Fluent:MenuItem.ResizeMode" Value="Vertical">
        <Setter Property="Visibility" TargetName="PART_ResizeBothThumb" Value="Collapsed" />
        <Setter Property="Visibility" TargetName="PART_ResizeVerticalThumb" Value="Visible" />
        <Setter Property="Visibility" TargetName="resizeBorder" Value="Visible" />
      </Trigger>
      <Trigger Property="IsChecked" Value="True">
        <Setter Property="Visibility" TargetName="rectangle" Value="Visible" />
      </Trigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="Icon" Value="{x:Null}" />
          <Condition Property="IsChecked" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="Visibility" TargetName="image" Value="Visible" />
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsHighlighted" Value="True" />
          <Condition Property="IsEnabled" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="Visibility" TargetName="PART_ButtonBorder" Value="Visible" />
        <Setter Property="Visibility" TargetName="border_Copy" Value="Visible" />
      </MultiTrigger>
      <Trigger Property="IsSubmenuOpen" Value="True">
        <Setter Property="Visibility" TargetName="border1_Copy" Value="Visible" />
      </Trigger>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="Opacity" TargetName="iconImage" Value="0.5" />
        <Setter Property="Opacity" TargetName="image" Value="0.5" />
        <Setter Property="Opacity" TargetName="textBlock" Value="0.5" />
        <Setter Property="Effect" TargetName="iconImage">
          <Setter.Value>
            <Fluent:GrayscaleEffect />
          </Setter.Value>
        </Setter>
        <Setter Property="Effect" TargetName="image">
          <Setter.Value>
            <Fluent:GrayscaleEffect />
          </Setter.Value>
        </Setter>
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <Style x:Key="MenuItemStyle" TargetType="{x:Type MenuItem}">
    <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
    <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden" />
    <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}" />
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
    <Setter Property="Foreground" Value="{StaticResource DefaultFontBrush}" />
    <Setter Property="SnapsToDevicePixels" Value="True" />
    <Setter Property="Fluent:FrameworkHelper.UseLayoutRounding" Value="True" />
    <Setter Property="Template" Value="{StaticResource MenuItemTemplate}" />
    <Style.Triggers>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="Fluent:MenuItem.IsSplited" Value="True" />
          <Condition Property="HasItems" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="Template" Value="{StaticResource SplitedMenuItemTemplate}" />
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="Fluent:MenuItem.IsSplited" Value="False" />
          <Condition Property="HasItems" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="Template" Value="{StaticResource HeaderMenuItemTemplate}" />
      </MultiTrigger>
    </Style.Triggers>
  </Style>
  <Style TargetType="{x:Type MenuItem}" BasedOn="{StaticResource MenuItemStyle}" />
  <Style TargetType="{x:Type Fluent:MenuItem}" BasedOn="{StaticResource {x:Type MenuItem}}" />
  <ControlTemplate x:Key="MenuSeparatorControlTemplate" TargetType="{x:Type Separator}">
    <Grid Height="Auto">
      <Path Fill="{x:Null}" Stretch="Fill" Stroke="{StaticResource ContextMenuSeparatorBrush}" StrokeDashArray="2 2" Margin="32,1,3,2" VerticalAlignment="Center" Height="1" Data="M0,0L1,0" />
    </Grid>
  </ControlTemplate>
  <Style x:Key="MenuGroupSeparatorStyle" TargetType="{x:Type Fluent:GroupSeparatorMenuItem}">
    <Setter Property="Template" Value="{StaticResource MenuGroupSeparatorControlTemplate}" />
    <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}" />
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
  </Style>
  <Style x:Key="{x:Type Fluent:GroupSeparatorMenuItem}" TargetType="{x:Type Fluent:GroupSeparatorMenuItem}" BasedOn="{StaticResource MenuGroupSeparatorStyle}" />
  <Style x:Key="GalleryDropDownButtonStyle" TargetType="{x:Type Fluent:DropDownButton}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Fluent:DropDownButton}">
          <Grid>
            <Border x:Name="PART_ButtonBorder" Background="Transparent">
              <Fluent:TwoLineLabel x:Name="twoLineLabel" Text="{Binding Header, RelativeSource={RelativeSource TemplatedParent}}" HasTwoLines="False" HasGlyph="True" Foreground="White" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="6,0,0,0" />
            </Border>
            <Popup x:Name="PART_Popup" Placement="Bottom" IsOpen="{TemplateBinding IsDropDownOpen}" AllowsTransparency="True" Focusable="False" PopupAnimation="Fade" Margin="0,0,-4,0" VerticalAlignment="Top" Grid.ColumnSpan="2">
              <Grid Name="DropDown" SnapsToDevicePixels="True" Margin="0" VerticalAlignment="Top">
                <Grid.RowDefinitions>
                  <RowDefinition Height="*" />
                  <RowDefinition Height="10" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="*" />
                  <ColumnDefinition Width="10" />
                </Grid.ColumnDefinitions>
                <Rectangle HorizontalAlignment="Left" VerticalAlignment="Top" Width="4" Height="4" Grid.Row="1" Grid.Column="1" StrokeThickness="0" Margin="-1,-1,0,0">
                  <Rectangle.Fill>
                    <RadialGradientBrush RadiusX="0.984" Center="0.017,0.002" GradientOrigin="0.017,0.002" RadiusY="1">
                      <GradientStop Color="#3F000000" Offset="0" />
                      <GradientStop Color="#00000000" Offset="1" />
                    </RadialGradientBrush>
                  </Rectangle.Fill>
                </Rectangle>
                <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="-1,3,0,0" VerticalAlignment="Top" Width="4" Height="4" Grid.Column="1" Grid.Row="0">
                  <Rectangle.Fill>
                    <RadialGradientBrush Center="0.032,1.01" GradientOrigin="0.032,1.01" RadiusX="0.984" RadiusY="1">
                      <GradientStop Color="#3F000000" Offset="0" />
                      <GradientStop Color="#00000000" Offset="1" />
                    </RadialGradientBrush>
                  </Rectangle.Fill>
                </Rectangle>
                <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="3,-1,0,0" VerticalAlignment="Top" Width="4" Height="4" Grid.Column="0" Grid.Row="1">
                  <Rectangle.Fill>
                    <RadialGradientBrush Center="0.996,0.027" GradientOrigin="0.996,0.027" RadiusX="0.984" RadiusY="1">
                      <GradientStop Color="#3F000000" Offset="0" />
                      <GradientStop Color="#00000000" Offset="1" />
                    </RadialGradientBrush>
                  </Rectangle.Fill>
                </Rectangle>
                <Rectangle StrokeThickness="0" HorizontalAlignment="Stretch" Margin="7,-1,1,0" VerticalAlignment="Top" Width="Auto" Height="4" Grid.Column="0" Grid.Row="1">
                  <Rectangle.Fill>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" MappingMode="RelativeToBoundingBox">
                      <GradientStop Color="#3F000000" Offset="0" />
                      <GradientStop Color="#00000000" Offset="1" />
                    </LinearGradientBrush>
                  </Rectangle.Fill>
                </Rectangle>
                <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="-1,7,0,1" VerticalAlignment="Stretch" Width="4" Height="Auto" Grid.Column="1" Grid.Row="0">
                  <Rectangle.Fill>
                    <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5" MappingMode="RelativeToBoundingBox">
                      <GradientStop Color="#3F000000" Offset="0" />
                      <GradientStop Color="#00000000" Offset="1" />
                    </LinearGradientBrush>
                  </Rectangle.Fill>
                </Rectangle>
                <Border x:Name="PART_DropDownBorder" MinWidth="{TemplateBinding ActualWidth}" SnapsToDevicePixels="True" Background="{StaticResource ContextMenuBarBackgroundBrush}" BorderBrush="{StaticResource ContextMenuBarBorderBrush}" BorderThickness="1" CornerRadius="1" Grid.ColumnSpan="1" d:LayoutOverrides="Width, Height" HorizontalAlignment="Stretch" VerticalAlignment="Top">
                  <Grid Width="Auto" Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Top">
                    <Border VerticalAlignment="Top" Width="Auto" Height="Auto" BorderBrush="{StaticResource ContextMenuBarBackgroundBrush}" BorderThickness="1" CornerRadius="1" />
                    <Grid Margin="1" HorizontalAlignment="Stretch" VerticalAlignment="Top">
                      <Rectangle Fill="{x:Null}" Stretch="Fill" Stroke="#FFE2E4E7" HorizontalAlignment="Left" Margin="24,0,0,0" Width="1" Height="Auto" Grid.RowSpan="2" Visibility="Visible" VerticalAlignment="Stretch" />
                      <ScrollViewer Margin="1" MaxHeight="{TemplateBinding MaxDropDownHeight}" SnapsToDevicePixels="True" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Hidden">
                        <Fluent:MenuPanel x:Name="PART_MenuPanel" IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle" />
                      </ScrollViewer>
                    </Grid>
                  </Grid>
                </Border>
              </Grid>
            </Popup>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
              <Setter Property="Foreground" TargetName="twoLineLabel" Value="#FFFFD232" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="GalleryItemStyle" TargetType="{x:Type Fluent:GalleryItem}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Fluent:GalleryItem}">
          <Grid Background="{StaticResource TransparentBrush}">
            <Border x:Name="hoverBorder" BorderBrush="{StaticResource ButtonHoverOuterBorderBrush}" BorderThickness="1" CornerRadius="2" d:LayoutOverrides="Width, Height" Background="{StaticResource ButtonHoverOuterBackgroundBrush}" Visibility="Collapsed">
              <Border Height="Auto" BorderBrush="{StaticResource ButtonHoverInnerBorderBrush}" BorderThickness="1" CornerRadius="1" Background="{StaticResource ButtonHoverInnerBackgroundBrush}" />
            </Border>
            <Border x:Name="selectedBorder" BorderBrush="{StaticResource ButtonHoverOuterBorderBrush}" BorderThickness="1" CornerRadius="2" d:LayoutOverrides="Width, Height" Background="{StaticResource ButtonHoverOuterBackgroundBrush}" Visibility="Collapsed">
              <Border Height="Auto" BorderBrush="{StaticResource ButtonHoverInnerBorderBrush}" BorderThickness="1" CornerRadius="1" Background="{StaticResource ButtonHoverInnerBackgroundBrush}" />
            </Border>
            <ContentPresenter x:Name="contentPresenter" Margin="1" Opacity="1" />
            <Border x:Name="pressedBorder" BorderBrush="{StaticResource ButtonPressedOuterBorderBrush}" BorderThickness="1" CornerRadius="2" d:LayoutOverrides="Width, Height" Background="{StaticResource ButtonPressedOuterBackgroundBrush}" Visibility="Collapsed" Opacity="0.5">
              <Border Height="Auto" BorderBrush="{StaticResource ButtonPressedInnerBorderBrush}" BorderThickness="1" CornerRadius="1" Background="{StaticResource ButtonPressedInnerBackgroundBrush}" />
            </Border>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsEnabled" Value="False">
              <Setter Property="Opacity" TargetName="contentPresenter" Value="0.5" />
            </Trigger>
            <Trigger Property="IsSelected" Value="True">
              <Setter Property="Visibility" TargetName="selectedBorder" Value="Visible" />
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True">
              <Setter Property="Visibility" TargetName="selectedBorder" Value="Visible" />
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
              <Setter Property="Visibility" TargetName="pressedBorder" Value="Visible" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <!--<Setter Property="Width" Value="{Binding ItemWidth, FallbackValue=0, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:RibbonItemsControl}}, Diagnostics:PresentationTraceSources.TraceLevel=None}"/>
    <Setter Property="Height" Value="{Binding ItemHeight, FallbackValue=0, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:RibbonItemsControl}}, Diagnostics:PresentationTraceSources.TraceLevel=None}"/>-->
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlStyleEmptyFocus}" />
  </Style>
  <Style x:Key="EditableComboBoxItemStyle" TargetType="{x:Type ComboBoxItem}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ComboBoxItem}">
          <Grid Background="{StaticResource TransparentBrush}">
            <Border x:Name="hoverBorder" BorderBrush="{StaticResource ButtonHoverOuterBorderBrush}" BorderThickness="1" CornerRadius="2" Background="{StaticResource ButtonHoverOuterBackgroundBrush}" Visibility="Collapsed">
              <Border Height="Auto" BorderBrush="{StaticResource ButtonHoverInnerBorderBrush}" BorderThickness="1" CornerRadius="1" Background="{StaticResource ButtonHoverInnerBackgroundBrush}" />
            </Border>
            <Border x:Name="selectedBorder" BorderBrush="{StaticResource ButtonHoverOuterBorderBrush}" BorderThickness="1" CornerRadius="2" Background="{StaticResource ButtonHoverOuterBackgroundBrush}" Visibility="Collapsed">
              <Border Height="Auto" BorderBrush="{StaticResource ButtonHoverInnerBorderBrush}" BorderThickness="1" CornerRadius="1" Background="{StaticResource ButtonHoverInnerBackgroundBrush}" />
            </Border>
            <ContentPresenter x:Name="contentPresenter" Margin="3" Opacity="1" />
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsEnabled" Value="False">
              <Setter Property="Opacity" TargetName="contentPresenter" Value="0.5" />
            </Trigger>
            <Trigger Property="IsSelected" Value="True">
              <Setter Property="Visibility" TargetName="selectedBorder" Value="Visible" />
            </Trigger>
            <Trigger Property="IsFocused" Value="True">
              <Setter Property="Visibility" TargetName="selectedBorder" Value="Visible" />
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True">
              <Setter Property="Visibility" TargetName="selectedBorder" Value="Visible" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlStyleEmptyFocus}" />
  </Style>
  <Style x:Key="NonEditableComboBoxItemStyle" TargetType="{x:Type ComboBoxItem}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ComboBoxItem}">
          <Grid Background="{StaticResource TransparentBrush}">
            <Border x:Name="hoverBorder" BorderBrush="{StaticResource ButtonHoverOuterBorderBrush}" BorderThickness="1" CornerRadius="2" Background="{StaticResource ButtonHoverOuterBackgroundBrush}" Visibility="Collapsed">
              <Border Height="Auto" BorderBrush="{StaticResource ButtonHoverInnerBorderBrush}" BorderThickness="1" CornerRadius="1" Background="{StaticResource ButtonHoverInnerBackgroundBrush}" />
            </Border>
            <Border x:Name="selectedBorder" BorderBrush="{StaticResource ButtonHoverOuterBorderBrush}" BorderThickness="1" CornerRadius="2" Background="{StaticResource ButtonHoverOuterBackgroundBrush}" Visibility="Collapsed">
              <Border Height="Auto" BorderBrush="{StaticResource ButtonHoverInnerBorderBrush}" BorderThickness="1" CornerRadius="1" Background="{StaticResource ButtonHoverInnerBackgroundBrush}" />
            </Border>
            <ContentPresenter x:Name="contentPresenter" Margin="3" Opacity="1" />
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsEnabled" Value="False">
              <Setter Property="Opacity" TargetName="contentPresenter" Value="0.5" />
            </Trigger>
            <Trigger Property="IsFocused" Value="True">
              <Setter Property="Visibility" TargetName="selectedBorder" Value="Visible" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlStyleEmptyFocus}" />
  </Style>
  <ControlTemplate x:Key="InRibbonGalleryToggleButtonControlTemplate" TargetType="{x:Type Fluent:ToggleButton}">
    <Border x:Name="border" BorderThickness="1" CornerRadius="2" Background="{StaticResource TransparentBrush}" BorderBrush="{StaticResource TransparentBrush}" Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
      <Border x:Name="border1" Height="Auto" BorderBrush="{StaticResource TransparentBrush}" BorderThickness="1" CornerRadius="2" Background="{StaticResource TransparentBrush}">
        <Grid Height="Auto">
          <Rectangle x:Name="rectangle" StrokeThickness="0" Visibility="Collapsed">
            <Rectangle.Fill>
              <RadialGradientBrush Center="0.503,1" GradientOrigin="0.503,1" RadiusY="0.202">
                <GradientStop Color="#7FFFFFFF" Offset="0" />
                <GradientStop Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <StackPanel x:Name="stackPanel" Width="Auto" Orientation="Vertical">
            <ContentPresenter x:Name="iconImage" HorizontalAlignment="Center" Height="32" VerticalAlignment="Center" Content="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource StringToImageConvert}}" Width="32" Margin="2" SnapsToDevicePixels="True" />
            <Fluent:TwoLineLabel x:Name="controlLabel" Text="{TemplateBinding Header}" Style="{StaticResource TwoLineLabelStyle}" HorizontalAlignment="Center" VerticalAlignment="Stretch" Margin="2,-2,2,2" HasGlyph="True" />
          </StackPanel>
        </Grid>
      </Border>
    </Border>
    <ControlTemplate.Triggers>
      <Trigger Property="Size" Value="Small">
        <Setter Property="Orientation" TargetName="stackPanel" Value="Horizontal" />
        <Setter Property="Content" TargetName="iconImage" Value="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource StringToImageConvert}}" />
        <Setter Property="HasTwoLines" TargetName="controlLabel" Value="False" />
        <Setter Property="Text" TargetName="controlLabel" Value="" />
        <Setter Property="Width" TargetName="iconImage" Value="16" />
        <Setter Property="Height" TargetName="iconImage" Value="16" />
        <Setter Property="Margin" TargetName="iconImage" Value="1,2,0,2" />
        <Setter Property="Margin" TargetName="controlLabel" Value="-2,0,2,2" />
        <Setter Property="Width" TargetName="controlLabel" Value="10" />
      </Trigger>
      <Trigger Property="Size" Value="Middle">
        <Setter Property="Orientation" TargetName="stackPanel" Value="Horizontal" />
        <Setter Property="Content" TargetName="iconImage" Value="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource StringToImageConvert}}" />
        <Setter Property="Width" TargetName="stackPanel" Value="Auto" />
        <Setter Property="VerticalAlignment" TargetName="iconImage" Value="Center" />
        <Setter Property="HasTwoLines" TargetName="controlLabel" Value="False" />
        <Setter Property="Margin" TargetName="controlLabel" Value="2,-2,2,2" />
        <Setter Property="VerticalAlignment" TargetName="border" Value="Stretch" />
        <Setter Property="Width" TargetName="iconImage" Value="16" />
        <Setter Property="Height" TargetName="iconImage" Value="16" />
        <Setter Property="Margin" TargetName="iconImage" Value="1,2,2,2" />
        <Setter Property="VerticalAlignment" TargetName="controlLabel" Value="Top" />
      </Trigger>
      <Trigger Property="IsChecked" Value="True">
        <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonPressedOuterBorderBrush}" />
        <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonPressedOuterBackgroundBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonPressedInnerBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonPressedInnerBorderBrush}" />
        <Setter Property="Visibility" TargetName="rectangle" Value="Visible" />
      </Trigger>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="Opacity" TargetName="iconImage" Value="0.5" />
        <Setter Property="Opacity" TargetName="controlLabel" Value="0.5" />
        <Setter Property="Effect" TargetName="iconImage">
          <Setter.Value>
            <Fluent:GrayscaleEffect />
          </Setter.Value>
        </Setter>
      </Trigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsMouseOver" Value="True" />
          <Condition Property="IsChecked" Value="False" />
        </MultiTrigger.Conditions>
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
        <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
        <Setter Property="Visibility" TargetName="rectangle" Value="Visible" />
      </MultiTrigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <Style x:Key="InRibbonGalleryButton" TargetType="{x:Type Fluent:ToggleButton}">
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlStyleEmptyFocus}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Fluent:ToggleButton}">
          <Border BorderBrush="{StaticResource ButtonBorderBrush}" BorderThickness="1,1,1,1" x:Name="border" Background="{StaticResource ButtonBackgroundBrush}">
            <Border BorderThickness="1,1,1,1" x:Name="border1">
              <Grid x:Name="grid">
                <Path Margin="0,6,0,0" VerticalAlignment="Top" Height="1" Fill="#FFFFFFFF" Stretch="Fill" Stroke="#FF000000" Data="M0,0L1,0" HorizontalAlignment="Center" Width="7" />
                <Path Margin="0,8,0,0" VerticalAlignment="Top" Height="3" Fill="#FF000000" Stretch="Fill" Stroke="#FF000000" Data="M0,0L1,1 2,0z" Width="5" HorizontalAlignment="Center" StrokeThickness="0" />
              </Grid>
            </Border>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsEnabled" Value="False">
              <Setter Property="Opacity" TargetName="grid" Value="0.5" />
              <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonDisabledBackgroundBrush}" />
              <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonDisabledBorderBrush}" />
            </Trigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsMouseOver" Value="True" />
                <Condition Property="IsPressed" Value="False" />
              </MultiTrigger.Conditions>
              <Setter Property="Background" TargetName="border" Value="{StaticResource TransparentBrush}" />
              <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
              <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
              <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
            </MultiTrigger>
            <Trigger Property="IsPressed" Value="True">
              <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonPressedOuterBackgroundBrush}" />
              <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonPressedOuterBorderBrush}" />
              <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonPressedInnerBorderBrush}" />
              <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonPressedInnerBackgroundBrush}" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="InRibbonGalleryRepeatButton" TargetType="{x:Type RepeatButton}">
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlStyleEmptyFocus}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type RepeatButton}">
          <Border BorderBrush="{StaticResource ButtonBorderBrush}" BorderThickness="1,1,1,1" x:Name="border" Background="{StaticResource ButtonBackgroundBrush}">
            <Border BorderThickness="1,1,1,1" x:Name="border1">
              <ContentPresenter x:Name="contentPresenter" />
            </Border>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsEnabled" Value="False">
              <Setter Property="Opacity" TargetName="contentPresenter" Value="0.5" />
              <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonDisabledBackgroundBrush}" />
              <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonDisabledBorderBrush}" />
            </Trigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsMouseOver" Value="True" />
                <Condition Property="IsPressed" Value="False" />
              </MultiTrigger.Conditions>
              <Setter Property="Background" TargetName="border" Value="{StaticResource TransparentBrush}" />
              <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
              <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
              <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
            </MultiTrigger>
            <Trigger Property="IsPressed" Value="True">
              <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonPressedOuterBackgroundBrush}" />
              <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonPressedOuterBorderBrush}" />
              <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonPressedInnerBorderBrush}" />
              <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonPressedInnerBackgroundBrush}" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <ControlTemplate x:Key="BackstageTabItemControlTemplate" TargetType="{x:Type Fluent:BackstageTabItem}">
    <Grid Background="#00000000">
      <Border x:Name="hoverBorder" Margin="0,0,1,0" Background="{Binding Background,&#xD;&#xA;                                         RelativeSource={RelativeSource FindAncestor,&#xD;&#xA;                                                                        AncestorType={x:Type Fluent:BackstageTabControl}}}" BorderBrush="{x:Null}" BorderThickness="0" Visibility="Collapsed">
        <Border Background="#BFFFFFFF" BorderBrush="#4C000000" BorderThickness="0,1" />
      </Border>
      <Border x:Name="selectedBorder" Margin="0" Background="{Binding Background,&#xD;&#xA;                                         RelativeSource={RelativeSource FindAncestor,&#xD;&#xA;                                                                        AncestorType={x:Type Fluent:BackstageTabControl}}}" BorderBrush="#FF000463" BorderThickness="0" Visibility="Collapsed">
        <Grid Width="Auto" Margin="0" HorizontalAlignment="Stretch">
          <Border BorderBrush="#7F000000" BorderThickness="0,1">
            <Border.Background>
              <RadialGradientBrush Center="0.5,0.972" GradientOrigin="0.5,0.972" RadiusX="0.662" RadiusY="1.193">
                <RadialGradientBrush.RelativeTransform>
                  <TransformGroup>
                    <ScaleTransform CenterX="0.5" CenterY="0.972" ScaleX="1" ScaleY="1" />
                    <SkewTransform AngleX="0" AngleY="0" CenterX="0.5" CenterY="0.972" />
                    <RotateTransform Angle="-0.659" CenterX="0.5" CenterY="0.972" />
                    <TranslateTransform />
                  </TransformGroup>
                </RadialGradientBrush.RelativeTransform>
                <GradientStop Offset="0" Color="#A5FFFFFF" />
                <GradientStop Offset="1" />
              </RadialGradientBrush>
            </Border.Background>
          </Border>
          <Path Width="8" Height="15" Margin="0,0,-1,0" HorizontalAlignment="Right" VerticalAlignment="Center" Data="M1,0L0,1 1,2z" Fill="{StaticResource BackstageBackgroundBrush}" Stretch="Fill" Stroke="{x:Null}" StrokeThickness="0" />
        </Grid>
      </Border>
      <ContentControl x:Name="PART_Header" Margin="20,0" HorizontalAlignment="Left" VerticalAlignment="Center" Content="{TemplateBinding Header}">
        <ContentControl.Resources>
          <Style TargetType="TextBlock">
            <Setter Property="TextWrapping" Value="NoWrap" />
            <Setter Property="TextTrimming" Value="CharacterEllipsis" />
          </Style>
        </ContentControl.Resources>
      </ContentControl>
    </Grid>
    <ControlTemplate.Triggers>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsMouseOver" Value="True" />
          <Condition Property="IsEnabled" Value="True" />
        </MultiTrigger.Conditions>
        <Setter TargetName="hoverBorder" Property="Visibility" Value="Visible" />
      </MultiTrigger>
      <Trigger Property="IsEnabled" Value="False">
        <Setter TargetName="hoverBorder" Property="Visibility" Value="Hidden" />
        <Setter TargetName="PART_Header" Property="Opacity" Value="0.5" />
      </Trigger>
      <Trigger Property="Selector.IsSelected" Value="True">
        <Setter TargetName="selectedBorder" Property="Visibility" Value="Visible" />
        <Setter TargetName="PART_Header" Property="Foreground" Value="White" />
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <Style x:Key="BackstageTabItemStyle" TargetType="{x:Type Fluent:BackstageTabItem}">
    <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}" />
    <Setter Property="Foreground" Value="{StaticResource BackstageFontBrush}" />
    <Setter Property="Template" Value="{StaticResource BackstageTabItemControlTemplate}" />
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlStyleEmptyFocus}" />
    <Setter Property="Height" Value="37" />
    <Setter Property="Background" Value="{Binding Background,&#xD;&#xA;                                RelativeSource={RelativeSource FindAncestor,&#xD;&#xA;                                                               AncestorType={x:Type Fluent:BackstageTabControl}}}" />
    <Setter Property="Margin" Value="0,1" />
  </Style>
  <ControlTemplate x:Key="ButtonBackstageControlTemplate" TargetType="{x:Type Fluent:Button}">
    <Grid x:Name="grid" MinHeight="85">
      <Rectangle x:Name="rectangle" Fill="{x:Null}" Stroke="{StaticResource ButtonBackstageShadowBrush}" Height="2" VerticalAlignment="Bottom" RadiusX="2" RadiusY="2" Margin="3,0" />
      <Border x:Name="border" BorderThickness="1" CornerRadius="3" Margin="0,0,0,1" BorderBrush="{StaticResource ButtonBackstageOutterBorderBrush}">
        <Border x:Name="border1" BorderBrush="Black" BorderThickness="0" CornerRadius="2" Background="{StaticResource ButtonBackstageInnerBackgroundBrush}">
          <StackPanel Margin="2" x:Name="stackPanel">
            <ContentPresenter x:Name="iconImage" HorizontalAlignment="Center" Height="32" VerticalAlignment="Center" Content="{Binding LargeIcon, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource StringToImageConvert}}" Width="32" Margin="9,9,9,0" SnapsToDevicePixels="True" />
            <Fluent:TwoLineLabel x:Name="twoLineLabel" Margin="7,7,7,5" VerticalAlignment="Center" Text="{TemplateBinding Header}" />
          </StackPanel>
        </Border>
      </Border>
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="Opacity" TargetName="iconImage" Value="0.5" />
        <Setter Property="Opacity" TargetName="twoLineLabel" Value="0.5" />
        <Setter Property="Effect" TargetName="iconImage">
          <Setter.Value>
            <Fluent:GrayscaleEffect />
          </Setter.Value>
        </Setter>
      </Trigger>
      <Trigger Property="Size" Value="Small">
        <Setter Property="Visibility" TargetName="iconImage" Value="Collapsed" />
        <Setter Property="Orientation" TargetName="stackPanel" Value="Horizontal" />
        <Setter Property="HorizontalAlignment" TargetName="stackPanel" Value="Center" />
        <Setter Property="VerticalAlignment" TargetName="stackPanel" Value="Center" />
        <Setter Property="Margin" TargetName="twoLineLabel" Value="2" />
        <Setter Property="Width" TargetName="grid" Value="Auto" />
        <Setter Property="Height" TargetName="grid" Value="Auto" />
        <Setter Property="HorizontalAlignment" TargetName="twoLineLabel" Value="Center" />
        <Setter Property="HasTwoLines" TargetName="twoLineLabel" Value="False" />
      </Trigger>
      <Trigger Property="Size" Value="Middle">
        <Setter Property="Orientation" TargetName="stackPanel" Value="Horizontal" />
        <Setter Property="VerticalAlignment" TargetName="stackPanel" Value="Center" />
        <Setter Property="Margin" TargetName="twoLineLabel" Value="7,0" />
        <Setter Property="Margin" TargetName="iconImage" Value="9,2,9,0" />
        <Setter Property="Width" TargetName="grid" Value="Auto" />
        <Setter Property="Height" TargetName="grid" Value="Auto" />
      </Trigger>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="BorderBrush" TargetName="border" Value="#FFC8C8C9" />
        <Setter Property="Opacity" TargetName="rectangle" Value="0" />
        <Setter Property="Background" TargetName="border1">
          <Setter.Value>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
              <GradientStop Color="White" Offset="0.009" />
              <GradientStop Color="#FFFBFBFB" Offset="1" />
            </LinearGradientBrush>
          </Setter.Value>
        </Setter>
      </Trigger>
      <Trigger Property="IsMouseOver" Value="True">
        <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
        <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
        <Setter Property="BorderThickness" TargetName="border1" Value="1" />
        <Setter Property="Margin" TargetName="stackPanel" Value="1" />
      </Trigger>
      <Trigger Property="IsFocused" Value="True">
        <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
        <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
        <Setter Property="BorderThickness" TargetName="border1" Value="1" />
        <Setter Property="Margin" TargetName="stackPanel" Value="1" />
      </Trigger>
      <Trigger Property="IsPressed" Value="True">
        <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonPressedOuterBorderBrush}" />
        <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonPressedOuterBackgroundBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonPressedInnerBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonPressedInnerBorderBrush}" />
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <ControlTemplate x:Key="ToggleButtonBackstageControlTemplate" TargetType="{x:Type Fluent:ToggleButton}">
    <Grid x:Name="grid" MinHeight="85">
      <Rectangle x:Name="rectangle" Fill="{x:Null}" Stroke="{StaticResource ButtonBackstageShadowBrush}" Height="2" VerticalAlignment="Bottom" RadiusX="2" RadiusY="2" Margin="3,0" />
      <Border x:Name="border" BorderThickness="1" CornerRadius="3" Margin="0,0,0,1" BorderBrush="{StaticResource ButtonBackstageOutterBorderBrush}">
        <Border x:Name="border1" BorderBrush="Black" BorderThickness="0" CornerRadius="2" Background="{StaticResource ButtonBackstageInnerBackgroundBrush}">
          <StackPanel Margin="2" x:Name="stackPanel">
            <ContentPresenter x:Name="iconImage" HorizontalAlignment="Center" Height="32" VerticalAlignment="Center" Content="{Binding LargeIcon, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource StringToImageConvert}}" Width="32" Margin="9,9,9,0" SnapsToDevicePixels="True" />
            <Fluent:TwoLineLabel x:Name="twoLineLabel" Margin="7,7,7,5" VerticalAlignment="Center" Text="{TemplateBinding Header}" />
          </StackPanel>
        </Border>
      </Border>
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="Opacity" TargetName="iconImage" Value="0.5" />
        <Setter Property="Opacity" TargetName="twoLineLabel" Value="0.5" />
        <Setter Property="Effect" TargetName="iconImage">
          <Setter.Value>
            <Fluent:GrayscaleEffect />
          </Setter.Value>
        </Setter>
      </Trigger>
      <Trigger Property="Size" Value="Small">
        <Setter Property="Visibility" TargetName="iconImage" Value="Collapsed" />
        <Setter Property="Orientation" TargetName="stackPanel" Value="Horizontal" />
        <Setter Property="HorizontalAlignment" TargetName="stackPanel" Value="Center" />
        <Setter Property="VerticalAlignment" TargetName="stackPanel" Value="Center" />
        <Setter Property="Margin" TargetName="twoLineLabel" Value="2" />
        <Setter Property="Width" TargetName="grid" Value="Auto" />
        <Setter Property="Height" TargetName="grid" Value="Auto" />
        <Setter Property="HorizontalAlignment" TargetName="twoLineLabel" Value="Center" />
        <Setter Property="HasTwoLines" TargetName="twoLineLabel" Value="False" />
      </Trigger>
      <Trigger Property="Size" Value="Middle">
        <Setter Property="Orientation" TargetName="stackPanel" Value="Horizontal" />
        <Setter Property="VerticalAlignment" TargetName="stackPanel" Value="Center" />
        <Setter Property="Margin" TargetName="twoLineLabel" Value="7,0" />
        <Setter Property="Margin" TargetName="iconImage" Value="9,2,9,0" />
        <Setter Property="Width" TargetName="grid" Value="Auto" />
        <Setter Property="Height" TargetName="grid" Value="Auto" />
      </Trigger>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="BorderBrush" TargetName="border" Value="#FFC8C8C9" />
        <Setter Property="Opacity" TargetName="rectangle" Value="0" />
        <Setter Property="Background" TargetName="border1">
          <Setter.Value>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
              <GradientStop Color="White" Offset="0.009" />
              <GradientStop Color="#FFFBFBFB" Offset="1" />
            </LinearGradientBrush>
          </Setter.Value>
        </Setter>
      </Trigger>
      <Trigger Property="IsMouseOver" Value="True">
        <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
        <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
        <Setter Property="BorderThickness" TargetName="border1" Value="1" />
        <Setter Property="Margin" TargetName="stackPanel" Value="1" />
      </Trigger>
      <Trigger Property="IsFocused" Value="True">
        <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
        <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
        <Setter Property="BorderThickness" TargetName="border1" Value="1" />
        <Setter Property="Margin" TargetName="stackPanel" Value="1" />
      </Trigger>
      <Trigger Property="IsPressed" Value="True">
        <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonPressedOuterBorderBrush}" />
        <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonPressedOuterBackgroundBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonPressedInnerBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonPressedInnerBorderBrush}" />
      </Trigger>
      <Trigger Property="IsChecked" Value="True">
        <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonPressedOuterBorderBrush}" />
        <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonPressedOuterBackgroundBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonPressedInnerBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonPressedInnerBorderBrush}" />
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <ControlTemplate x:Key="DropDownButtonBackstageControlTemplate" TargetType="{x:Type Fluent:DropDownButton}">
    <Grid>
      <Rectangle x:Name="rectangle" Fill="{x:Null}" Stroke="{StaticResource ButtonBackstageShadowBrush}" Height="2" VerticalAlignment="Bottom" RadiusX="2" RadiusY="2" Margin="3,0" />
      <Border x:Name="PART_ButtonBorder" BorderThickness="1" CornerRadius="3" Margin="0,0,0,1" BorderBrush="{StaticResource ButtonBackstageOutterBorderBrush}">
        <Border x:Name="border1" BorderBrush="Black" BorderThickness="0" CornerRadius="2" Background="{StaticResource ButtonBackstageInnerBackgroundBrush}">
          <StackPanel x:Name="stackPanel" Margin="2">
            <ContentPresenter x:Name="iconImage" HorizontalAlignment="Center" Height="32" VerticalAlignment="Center" Content="{Binding LargeIcon, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource StringToImageConvert}}" Width="32" Margin="7,7,7,0" SnapsToDevicePixels="True" />
            <Fluent:TwoLineLabel x:Name="twoLineLabel" Margin="5,5,5,3" VerticalAlignment="Center" HasGlyph="True" Text="{TemplateBinding Header}" />
          </StackPanel>
        </Border>
      </Border>
      <Popup x:Name="PART_Popup" Placement="Bottom" IsOpen="{TemplateBinding IsDropDownOpen}" AllowsTransparency="True" Focusable="False" PopupAnimation="Fade" Margin="0,0,-4,0" VerticalAlignment="Top" Grid.ColumnSpan="2">
        <Grid Name="DropDown" SnapsToDevicePixels="True" Margin="0" VerticalAlignment="Top">
          <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="10" />
          </Grid.RowDefinitions>
          <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="10" />
          </Grid.ColumnDefinitions>
          <Rectangle HorizontalAlignment="Left" VerticalAlignment="Top" Width="4" Height="4" Grid.Row="1" Grid.Column="1" StrokeThickness="0" Margin="-1,-1,0,0">
            <Rectangle.Fill>
              <RadialGradientBrush RadiusX="0.984" Center="0.017,0.002" GradientOrigin="0.017,0.002" RadiusY="1">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="-1,3,0,0" VerticalAlignment="Top" Width="4" Height="4" Grid.Column="1" Grid.Row="0">
            <Rectangle.Fill>
              <RadialGradientBrush Center="0.032,1.01" GradientOrigin="0.032,1.01" RadiusX="0.984" RadiusY="1">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="3,-1,0,0" VerticalAlignment="Top" Width="4" Height="4" Grid.Column="0" Grid.Row="1">
            <Rectangle.Fill>
              <RadialGradientBrush Center="0.996,0.027" GradientOrigin="0.996,0.027" RadiusX="0.984" RadiusY="1">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Stretch" Margin="7,-1,1,0" VerticalAlignment="Top" Width="Auto" Height="4" Grid.Column="0" Grid.Row="1">
            <Rectangle.Fill>
              <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" MappingMode="RelativeToBoundingBox">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </LinearGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="-1,7,0,1" VerticalAlignment="Stretch" Width="4" Height="Auto" Grid.Column="1" Grid.Row="0">
            <Rectangle.Fill>
              <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5" MappingMode="RelativeToBoundingBox">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </LinearGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Border x:Name="PART_DropDownBorder" MinWidth="{TemplateBinding ActualWidth}" SnapsToDevicePixels="True" Background="{StaticResource ContextMenuBarBackgroundBrush}" BorderBrush="{StaticResource ContextMenuBarBorderBrush}" BorderThickness="1" CornerRadius="1" Grid.ColumnSpan="1" HorizontalAlignment="Stretch" VerticalAlignment="Top">
            <Grid Width="Auto" Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Top">
              <Border VerticalAlignment="Top" Width="Auto" Height="Auto" BorderBrush="{StaticResource ContextMenuBarBackgroundBrush}" BorderThickness="1" CornerRadius="1" />
              <Grid Margin="1" HorizontalAlignment="Stretch" VerticalAlignment="Top">
                <Grid.RowDefinitions>
                  <RowDefinition Height="*" />
                  <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Rectangle Fill="{x:Null}" Stretch="Fill" Stroke="#FFE2E4E7" HorizontalAlignment="Left" Margin="24,0,0,0" Width="1" Height="Auto" Grid.RowSpan="2" Visibility="Visible" VerticalAlignment="Stretch" />
                <ScrollViewer Margin="1" MaxHeight="{TemplateBinding MaxDropDownHeight}" SnapsToDevicePixels="True" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Hidden">
                  <Fluent:MenuPanel x:Name="PART_MenuPanel" IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle" />
                </ScrollViewer>
                <Border x:Name="resizeBorder" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="11" BorderBrush="{StaticResource ContextMenuBarResizeBorderBrush}" BorderThickness="0,1,0,0" Grid.Row="1" CornerRadius="0,0,1,1" Background="{StaticResource ContextMenuBarResizeBackgoundBrush}">
                  <Grid>
                    <Thumb x:Name="PART_ResizeVerticalThumb" HorizontalAlignment="Stretch" Margin="0,0,0,-90" Width="Auto" Height="10" VerticalAlignment="Top" Cursor="SizeNS" Template="{StaticResource ResizeVerticalThumbControlTemplate}" />
                    <Thumb x:Name="PART_ResizeBothThumb" HorizontalAlignment="Right" Margin="0,0,0,-90" Width="10" Height="10" VerticalAlignment="Top" Cursor="SizeNWSE" Template="{StaticResource ResizeBothThumbControlTemplate}" />
                  </Grid>
                </Border>
              </Grid>
            </Grid>
          </Border>
        </Grid>
      </Popup>
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="ResizeMode" Value="None">
        <Setter Property="Visibility" TargetName="resizeBorder" Value="Collapsed" />
      </Trigger>
      <Trigger Property="ResizeMode" Value="Both">
        <Setter Property="Visibility" TargetName="PART_ResizeVerticalThumb" Value="Collapsed" />
        <Setter Property="Visibility" TargetName="PART_ResizeBothThumb" Value="Visible" />
        <Setter Property="Visibility" TargetName="resizeBorder" Value="Visible" />
      </Trigger>
      <Trigger Property="ResizeMode" Value="Vertical">
        <Setter Property="Visibility" TargetName="PART_ResizeBothThumb" Value="Collapsed" />
        <Setter Property="Visibility" TargetName="PART_ResizeVerticalThumb" Value="Visible" />
        <Setter Property="Visibility" TargetName="resizeBorder" Value="Visible" />
      </Trigger>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="Opacity" TargetName="iconImage" Value="0.5" />
        <Setter Property="Opacity" TargetName="twoLineLabel" Value="0.5" />
        <Setter Property="Effect" TargetName="iconImage">
          <Setter.Value>
            <Fluent:GrayscaleEffect />
          </Setter.Value>
        </Setter>
        <Setter Property="BorderBrush" TargetName="PART_ButtonBorder" Value="#FFC8C8C9" />
        <Setter Property="Opacity" TargetName="rectangle" Value="0" />
        <Setter Property="Background" TargetName="PART_ButtonBorder">
          <Setter.Value>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
              <GradientStop Color="White" Offset="0.009" />
              <GradientStop Color="#FFFBFBFB" Offset="1" />
            </LinearGradientBrush>
          </Setter.Value>
        </Setter>
      </Trigger>
      <Trigger Property="IsMouseOver" Value="True">
        <Setter Property="BorderBrush" TargetName="PART_ButtonBorder" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
        <Setter Property="Background" TargetName="PART_ButtonBorder" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
        <Setter Property="BorderThickness" TargetName="border1" Value="1" />
        <Setter Property="Margin" TargetName="stackPanel" Value="1" />
      </Trigger>
      <Trigger Property="IsFocused" Value="True">
        <Setter Property="BorderBrush" TargetName="PART_ButtonBorder" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
        <Setter Property="Background" TargetName="PART_ButtonBorder" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
        <Setter Property="BorderThickness" TargetName="border1" Value="1" />
        <Setter Property="Margin" TargetName="stackPanel" Value="1" />
      </Trigger>
      <Trigger Property="IsDropDownOpen" Value="True">
        <Setter Property="BorderBrush" TargetName="PART_ButtonBorder" Value="{StaticResource ButtonPressedOuterBorderBrush}" />
        <Setter Property="Background" TargetName="PART_ButtonBorder" Value="{StaticResource ButtonPressedOuterBackgroundBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonPressedInnerBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonPressedInnerBorderBrush}" />
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <Style x:Key="GalleryItemBackstageStyle" TargetType="{x:Type Fluent:GalleryItem}">
    <Setter Property="HorizontalAlignment" Value="Stretch" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Fluent:GalleryItem}">
          <Grid Background="{StaticResource TransparentBrush}">
            <Border x:Name="hoverBorder" BorderBrush="{StaticResource ButtonHoverOuterBorderBrush}" BorderThickness="1" CornerRadius="2" Background="{StaticResource ButtonHoverOuterBackgroundBrush}" Visibility="Collapsed">
              <Border Height="Auto" BorderBrush="{StaticResource ButtonHoverInnerBorderBrush}" BorderThickness="1" CornerRadius="1" Background="{StaticResource ButtonHoverInnerBackgroundBrush}" />
            </Border>
            <Border x:Name="selectedBorder" BorderBrush="#FFF29536" BorderThickness="1" CornerRadius="2" Background="#FFFCF1C2" Visibility="Collapsed" Width="40" Height="38" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="1,0,0,0" />
            <ContentPresenter x:Name="contentPresenter" Margin="1" Opacity="1" />
            <Border x:Name="pressedBorder" BorderBrush="{StaticResource ButtonPressedOuterBorderBrush}" BorderThickness="1" CornerRadius="2" Background="{StaticResource ButtonPressedOuterBackgroundBrush}" Visibility="Collapsed" Opacity="0.5">
              <Border Height="Auto" BorderBrush="{StaticResource ButtonPressedInnerBorderBrush}" BorderThickness="1" CornerRadius="1" Background="{StaticResource ButtonPressedInnerBackgroundBrush}" />
            </Border>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsEnabled" Value="False">
              <Setter Property="Opacity" TargetName="contentPresenter" Value="0.5" />
            </Trigger>
            <Trigger Property="IsSelected" Value="True">
              <Setter Property="Visibility" TargetName="selectedBorder" Value="Visible" />
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True">
              <Setter Property="Visibility" TargetName="hoverBorder" Value="Visible" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlStyleEmptyFocus}" />
  </Style>
  <Style x:Key="ComboBoxItemBackstageStyle" TargetType="{x:Type ComboBoxItem}">
    <Setter Property="HorizontalAlignment" Value="Stretch" />
    <Setter Property="MinHeight" Value="40" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ComboBoxItem}">
          <Grid Background="{StaticResource TransparentBrush}" HorizontalAlignment="Stretch">
            <Border x:Name="hoverBorder" BorderBrush="{StaticResource ButtonHoverOuterBorderBrush}" BorderThickness="1" CornerRadius="2" Background="{StaticResource ButtonHoverOuterBackgroundBrush}" Visibility="Collapsed">
              <Border Height="Auto" BorderBrush="{StaticResource ButtonHoverInnerBorderBrush}" BorderThickness="1" CornerRadius="1" Background="{StaticResource ButtonHoverInnerBackgroundBrush}" />
            </Border>
            <Border x:Name="selectedBorder" BorderBrush="#FFF29536" BorderThickness="1" CornerRadius="2" Background="#FFFCF1C2" Visibility="Collapsed" Width="40" Height="38" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="1,0,0,0" />
            <ContentPresenter x:Name="contentPresenter" Margin="1" Opacity="1" />
            <Border x:Name="pressedBorder" BorderBrush="{StaticResource ButtonPressedOuterBorderBrush}" BorderThickness="1" CornerRadius="2" Background="{StaticResource ButtonPressedOuterBackgroundBrush}" Visibility="Collapsed" Opacity="0.5">
              <Border Height="Auto" BorderBrush="{StaticResource ButtonPressedInnerBorderBrush}" BorderThickness="1" CornerRadius="1" Background="{StaticResource ButtonPressedInnerBackgroundBrush}" />
            </Border>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsEnabled" Value="False">
              <Setter Property="Opacity" TargetName="contentPresenter" Value="0.5" />
            </Trigger>
            <Trigger Property="IsSelected" Value="True">
              <Setter Property="Visibility" TargetName="selectedBorder" Value="Visible" />
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True">
              <Setter Property="Visibility" TargetName="hoverBorder" Value="Visible" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlStyleEmptyFocus}" />
  </Style>
  <ControlTemplate x:Key="SpinnerButtonBackstageControlTemplate" TargetType="{x:Type RepeatButton}">
    <Border x:Name="border" BorderThickness="1" CornerRadius="2" Background="{StaticResource TransparentBrush}" BorderBrush="{StaticResource TransparentBrush}" Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
      <Border x:Name="border1" Height="Auto" BorderBrush="{StaticResource TransparentBrush}" BorderThickness="1" CornerRadius="2" Background="{StaticResource TransparentBrush}">
        <Grid Height="Auto">
          <Rectangle x:Name="rectangle" StrokeThickness="0" Visibility="Collapsed">
            <Rectangle.Fill>
              <RadialGradientBrush Center="0.503,1" GradientOrigin="0.503,1" RadiusY="0.202">
                <GradientStop Color="#7FFFFFFF" Offset="0" />
                <GradientStop Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <ContentPresenter x:Name="contentPresenter" HorizontalAlignment="Center" VerticalAlignment="Center" />
        </Grid>
      </Border>
    </Border>
    <ControlTemplate.Triggers>
      <Trigger Property="Border.BorderThickness" Value="0,1,0,0">
        <Setter Property="CornerRadius" TargetName="border" Value="0,2,0,0" />
        <Setter Property="CornerRadius" TargetName="border1" Value="0,1,0,0" />
      </Trigger>
      <Trigger Property="Border.BorderThickness" Value="0,0,1,0">
        <Setter Property="CornerRadius" TargetName="border" Value="0,0,3,0" />
        <Setter Property="CornerRadius" TargetName="border1" Value="0,0,2,0" />
      </Trigger>
      <Trigger Property="IsMouseOver" Value="False" />
      <Trigger Property="IsPressed" Value="True">
        <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonPressedOuterBorderBrush}" />
        <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonPressedOuterBackgroundBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonPressedInnerBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonPressedInnerBorderBrush}" />
      </Trigger>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="Opacity" TargetName="contentPresenter" Value="0.5" />
      </Trigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsMouseOver" Value="True" />
          <Condition Property="IsPressed" Value="False" />
        </MultiTrigger.Conditions>
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
        <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
        <Setter Property="Visibility" TargetName="rectangle" Value="Visible" />
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsKeyboardFocusWithin" Value="True" />
          <Condition Property="IsPressed" Value="False" />
        </MultiTrigger.Conditions>
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
        <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
      </MultiTrigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <Style x:Key="SpinnerButtonBackstageStyle" TargetType="{x:Type RepeatButton}">
    <Setter Property="Template" Value="{StaticResource SpinnerButtonBackstageControlTemplate}" />
    <Setter Property="Foreground" Value="{StaticResource DefaultFontBrush}" />
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlStyleEmptyFocus}" />
  </Style>
  <Style x:Key="SpinnerBackstageStyle" TargetType="{x:Type Fluent:Spinner}">
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlStyleEmptyFocus}" />
    <Setter Property="Foreground" Value="{StaticResource DefaultFontBrush}" />
    <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}" />
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Fluent:Spinner}">
          <Grid Width="Auto" Height="22" Background="#00000000">
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="Auto" />
              <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <StackPanel Orientation="Horizontal" Grid.ColumnSpan="1" x:Name="stackPanel" HorizontalAlignment="Left" Margin="0">
              <Image Width="16" Height="16" VerticalAlignment="Center" Margin="4,0,3,0" Source="{TemplateBinding Icon}" />
              <TextBlock Text="{TemplateBinding Header}" TextWrapping="Wrap" VerticalAlignment="Center" Margin="2,0,4,0" x:Name="textBlock" />
            </StackPanel>
            <Border x:Name="border" Height="22" BorderThickness="1" Background="{StaticResource TextBoxBackgroundBrush}" Grid.ColumnSpan="1" Grid.Column="1" Width="{TemplateBinding InputWidth}" CornerRadius="2">
              <Border.BorderBrush>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                  <GradientStop Color="#FFABAFB2" Offset="0" />
                  <GradientStop Color="#FFE1E6EC" Offset="1" />
                </LinearGradientBrush>
              </Border.BorderBrush>
              <Grid Grid.ColumnSpan="1" Grid.Column="1">
                <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="*" />
                  <ColumnDefinition Width="17" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                  <RowDefinition Height="*" />
                  <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <TextBox x:Name="PART_TextBox" BorderThickness="0" Grid.RowSpan="2" Grid.Column="0" Background="{StaticResource TextBoxBackgroundBrush}" Margin="1,0,0,0" Padding="1" />
                <Border x:Name="border1" BorderBrush="#FFBEC1C4" BorderThickness="1" Margin="0,-1,-1,0" Grid.RowSpan="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" CornerRadius="0,2,0,0" Grid.Column="1" Visibility="Collapsed">
                  <Border.Background>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                      <GradientStop Color="White" Offset="0" />
                      <GradientStop Color="#FFF1F2F2" Offset="1" />
                    </LinearGradientBrush>
                  </Border.Background>
                </Border>
                <Border x:Name="border2" BorderBrush="#FFBEC1C4" BorderThickness="1" Grid.ColumnSpan="1" Margin="0,-1,-1,-1" Grid.RowSpan="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="18" CornerRadius="0,0,2,0" Grid.Column="1" Grid.Row="1" Visibility="Collapsed">
                  <Border.Background>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                      <GradientStop Color="White" Offset="0" />
                      <GradientStop Color="#FFF1F2F2" Offset="1" />
                    </LinearGradientBrush>
                  </Border.Background>
                </Border>
                <RepeatButton x:Name="PART_ButtonUp" Grid.Column="1" Grid.Row="0" Style="{StaticResource SpinnerButtonBackstageStyle}" RenderTransformOrigin="0,0.5" HorizontalAlignment="Stretch" BorderThickness="0,1,0,0" Margin="0,-1,-1,0">
                  <Path Width="7" Height="4" Fill="#FF757778" Stretch="Fill" Stroke="#FF000000" Data="M0,0L1,-1 2,0" HorizontalAlignment="Center" StrokeThickness="0" VerticalAlignment="Center" Margin="1,1,0,1" RenderOptions.EdgeMode="Aliased" />
                </RepeatButton>
                <RepeatButton x:Name="PART_ButtonDown" Grid.Column="1" Grid.Row="1" Style="{StaticResource SpinnerButtonBackstageStyle}" BorderThickness="0,0,1,0" Margin="0,0,-1,-1">
                  <Path Width="7" Height="4" Fill="#FF757778" Stretch="Fill" Stroke="#FF000000" Data="M0,0L1,1 2,0" StrokeThickness="0" HorizontalAlignment="Center" Margin="1,0,0,0" VerticalAlignment="Center" RenderOptions.EdgeMode="Aliased" />
                </RepeatButton>
              </Grid>
            </Border>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsEnabled" Value="False">
              <Setter Property="IsEnabled" TargetName="PART_TextBox" Value="False" />
              <Setter Property="Background" TargetName="border" Value="{StaticResource TextBoxDisabledBackgroundBrush}" />
              <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource TextBoxDisabledBorderBrush}" />
              <Setter Property="Background" TargetName="PART_TextBox" Value="{StaticResource TextBoxDisabledBackgroundBrush}" />
            </Trigger>
            <Trigger Property="Size" Value="Middle">
              <Setter Property="Visibility" TargetName="textBlock" Value="Collapsed" />
            </Trigger>
            <Trigger Property="Size" Value="Small">
              <Setter Property="Visibility" TargetName="stackPanel" Value="Collapsed" />
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True">
              <Setter Property="Background" TargetName="border" Value="{StaticResource TextBoxHoverBackgroundBrush}" />
              <Setter Property="Background" TargetName="PART_TextBox" Value="{StaticResource TextBoxHoverBackgroundBrush}" />
              <Setter Property="BorderBrush" TargetName="border">
                <Setter.Value>
                  <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFCFAF5A" Offset="0" />
                    <GradientStop Color="#FFEFDA71" Offset="1" />
                  </LinearGradientBrush>
                </Setter.Value>
              </Setter>
              <Setter Property="Visibility" TargetName="border1" Value="Visible" />
              <Setter Property="Visibility" TargetName="border2" Value="Visible" />
              <Setter Property="BorderBrush" TargetName="border1" Value="#E5BEC1C4" />
              <Setter Property="BorderBrush" TargetName="border2" Value="#E5BEC1C4" />
            </Trigger>
            <Trigger Property="IsFocused" Value="True" SourceName="PART_TextBox">
              <Setter Property="Background" TargetName="border" Value="{StaticResource TextBoxHoverBackgroundBrush}" />
              <Setter Property="Background" TargetName="PART_TextBox" Value="{StaticResource TextBoxHoverBackgroundBrush}" />
              <Setter Property="BorderBrush" TargetName="border">
                <Setter.Value>
                  <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFCFAF5A" Offset="0" />
                    <GradientStop Color="#FFEFDA71" Offset="1" />
                  </LinearGradientBrush>
                </Setter.Value>
              </Setter>
              <Setter Property="Visibility" TargetName="border1" Value="Visible" />
              <Setter Property="Visibility" TargetName="border2" Value="Visible" />
              <Setter Property="BorderBrush" TargetName="border1" Value="#E5BEC1C4" />
              <Setter Property="BorderBrush" TargetName="border2" Value="#E5BEC1C4" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="{x:Type Fluent:SeparatorTabItem}" x:Key="InnerBackstageSeparatorTabItemStyle">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Fluent:SeparatorTabItem}">
          <Grid Margin="0,0,10,0">
            <TextBlock Margin="0,5" TextWrapping="Wrap" Text="{TemplateBinding Header}" VerticalAlignment="Center" FontSize="14" FontWeight="Bold" Foreground="#FF5E5E5E" />
            <Path Data="M0,0L1,0" Fill="{x:Null}" Height="1" Margin="0" StrokeStartLineCap="Flat" Stretch="Fill" StrokeEndLineCap="Flat" Stroke="{StaticResource RibbonTopBorderBrush}" StrokeThickness="1" StrokeMiterLimit="10" StrokeLineJoin="Miter" VerticalAlignment="Bottom" StrokeDashArray="2 2" />
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="InnerBackstageTabCotrolItem" TargetType="{x:Type TabItem}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type TabItem}">
          <Grid Background="#00000000" Margin="0,3">
            <Border x:Name="border" BorderBrush="{StaticResource TransparentBrush}" BorderThickness="1" Margin="0" CornerRadius="3" Background="{StaticResource TransparentBrush}">
              <Border x:Name="border1" BorderBrush="{StaticResource TransparentBrush}" BorderThickness="1" CornerRadius="2" Background="{StaticResource TransparentBrush}">
                <ContentPresenter Margin="5,5,50,5" ContentSource="Header" />
              </Border>
            </Border>
            <Path x:Name="path" Data="M1,0L0,1 1,2" Fill="#FFF4F4F5" HorizontalAlignment="Right" Height="11" Margin="0,0,-1,0" StrokeStartLineCap="Flat" Stretch="Fill" StrokeEndLineCap="Flat" Stroke="{StaticResource RibbonTopBorderBrush}" StrokeThickness="1" StrokeMiterLimit="10" StrokeLineJoin="Miter" VerticalAlignment="Center" Width="6" Visibility="Collapsed" />
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="Selector.IsSelected" Value="True">
              <Setter Property="Visibility" TargetName="path" Value="Visible" />
              <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonPressedOuterBackgroundBrush}" />
              <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonPressedOuterBorderBrush}" />
              <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonPressedInnerBorderBrush}" />
              <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonPressedInnerBackgroundBrush}" />
            </Trigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsMouseOver" Value="True" />
                <Condition Property="Selector.IsSelected" Value="False" />
              </MultiTrigger.Conditions>
              <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
              <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
              <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
              <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
            </MultiTrigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="InnerBackstageTabControlStyle" TargetType="{x:Type TabControl}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type TabControl}">
          <ControlTemplate.Resources>
            <Style TargetType="{x:Type Fluent:SeparatorTabItem}" BasedOn="{StaticResource InnerBackstageSeparatorTabItemStyle}" />
            <Style TargetType="{x:Type TabItem}" BasedOn="{StaticResource InnerBackstageTabCotrolItem}" />
          </ControlTemplate.Resources>
          <Grid>
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="Auto" />
              <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Border BorderThickness="0,0,1,0" HorizontalAlignment="Stretch" Margin="0" VerticalAlignment="Stretch">
              <Border.BorderBrush>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                  <GradientStop Offset="1" Color="#00D2D3D4" />
                  <GradientStop Color="#7FD2D3D4" />
                  <GradientStop Color="#FFD2D3D4" Offset="0.246" />
                  <GradientStop Color="#FFD2D3D4" Offset="0.797" />
                </LinearGradientBrush>
              </Border.BorderBrush>
            </Border>
            <StackPanel Grid.Column="0" HorizontalAlignment="Left" Margin="0" VerticalAlignment="Top" IsItemsHost="True" />
            <ContentPresenter x:Name="PART_SelectedContentHost" Grid.Column="1" Margin="0" VerticalAlignment="Stretch" ContentSource="SelectedContent" />
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="BackstageButtonStyle" TargetType="{x:Type Fluent:Button}">
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlStyleEmptyFocus}" />
    <Setter Property="Height" Value="26" />
    <Setter Property="Margin" Value="5,1" />
    <Setter Property="Template" Value="{StaticResource BackstageButtonControlTemplate}" />
    <Setter Property="Background" Value="{Binding Background, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:BackstageTabControl}}, FallbackValue=Red}" />
    <Setter Property="Foreground" Value="{StaticResource BackstageFontBrush}" />
  </Style>
  <Style TargetType="{x:Type Fluent:SeparatorTabItem}" x:Key="BackstageSeparatorTabItemStyle">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Fluent:SeparatorTabItem}">
          <Grid Margin="0,0,10,0">
            <TextBlock x:Name="header" Margin="5,5" TextWrapping="Wrap" Text="{TemplateBinding Header}" VerticalAlignment="Center" FontSize="14" FontWeight="Bold" Foreground="#FF5E5E5E" Visibility="Visible" />
            <Path Data="M0,0L1,0" Fill="{x:Null}" Height="1" Margin="0" StrokeStartLineCap="Flat" Stretch="Fill" StrokeEndLineCap="Flat" Stroke="{StaticResource RibbonTopBorderBrush}" StrokeThickness="1" StrokeMiterLimit="10" StrokeLineJoin="Miter" VerticalAlignment="Bottom" StrokeDashArray="2 2" />
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="HasHeader" Value="False">
              <Setter TargetName="header" Property="Visibility" Value="Collapsed" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="RibbonSeparatorStyle" TargetType="{x:Type Separator}">
    <Setter Property="Margin" Value="4,0,4,0" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="Separator">
          <Border BorderThickness="1,0" Width="3" Height="Auto" VerticalAlignment="Stretch" Background="{StaticResource RibbonSeparatorBackgroundBrush}" BorderBrush="{StaticResource RibbonSeparatorBorderBrush}" />
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="RibbonToolBarStyle" TargetType="{x:Type Fluent:RibbonToolBar}">
    <Setter Property="Focusable" Value="False" />
    <Setter Property="SeparatorStyle">
      <Setter.Value>
        <Style TargetType="{x:Type Separator}" BasedOn="{StaticResource RibbonSeparatorStyle}">
          <Setter Property="Margin" Value="4" />
        </Style>
      </Setter.Value>
    </Setter>
  </Style>
  <ControlTemplate x:Key="RibbonToolBarControlGroupTemplate" TargetType="{x:Type Fluent:RibbonToolBarControlGroup}">
    <StackPanel Orientation="Horizontal">
      <Separator x:Name="separatorLeft" Visibility="Collapsed" Style="{StaticResource RibbonSeparatorStyle}" />
      <StackPanel Orientation="Horizontal" IsItemsHost="true" />
      <Separator x:Name="separatorRight" Visibility="Collapsed" Style="{StaticResource RibbonSeparatorStyle}" />
    </StackPanel>
    <ControlTemplate.Triggers>
      <Trigger Property="IsLastInRow" Value="False">
        <Setter Property="Visibility" TargetName="separatorRight" Value="Visible" />
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <Style x:Key="{x:Type StatusBar}" TargetType="{x:Type StatusBar}">
    <Setter Property="OverridesDefaultStyle" Value="True" />
    <Setter Property="SnapsToDevicePixels" Value="True" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type StatusBar}">
          <Border BorderThickness="0,1" BorderBrush="{StaticResource StatusBarBorderBrushBrush}">
            <Border Height="Auto" BorderThickness="0,1" BorderBrush="{StaticResource StatusBarInnerBorderBrush}" Background="{StaticResource StatusBarInnerBackgroundBrush}">
              <ItemsPresenter Height="Auto" />
            </Border>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="{x:Static StatusBar.SeparatorStyleKey}" TargetType="{x:Type Separator}">
    <Setter Property="OverridesDefaultStyle" Value="True" />
    <Setter Property="SnapsToDevicePixels" Value="True" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Separator}">
          <Border BorderThickness="1,0" Margin="0,-1,0,0" Width="3" Background="{StaticResource StatusBarSeparatorBackgroundBrush}" BorderBrush="{StaticResource StatusBarSeparatorBorderBrush}" />
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="ScrollBarLineButton" TargetType="{x:Type RepeatButton}">
    <Setter Property="SnapsToDevicePixels" Value="True" />
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="Focusable" Value="false" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type RepeatButton}">
          <Border Name="Border" Margin="0" CornerRadius="1" BorderThickness="1" BorderBrush="{StaticResource ScrollOutterBorderBrush}" Background="{StaticResource ScrollOutterBackgroundBrush}">
            <Border x:Name="border" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" CornerRadius="1" BorderThickness="1" BorderBrush="{StaticResource ScrollInnerBorderBrush}" Background="{StaticResource ScrollInnerBackgroundBrush}">
              <Path x:Name="path" Data="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}" Width="Auto" Height="Auto" HorizontalAlignment="Center" VerticalAlignment="Center" Fill="{TemplateBinding Foreground}" />
            </Border>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="Panel.Background" Value="White">
              <Setter Property="Background" TargetName="Border" Value="{StaticResource TransparentBrush}" />
              <Setter Property="BorderBrush" TargetName="Border" Value="{StaticResource TransparentBrush}" />
              <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource TransparentBrush}" />
              <Setter Property="Background" TargetName="border" Value="{StaticResource TransparentBrush}" />
            </Trigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsMouseOver" Value="True" />
                <Condition Property="IsPressed" Value="False" />
              </MultiTrigger.Conditions>
              <Setter Property="BorderBrush" TargetName="Border" Value="{StaticResource ScrollOverOutterBorderBrush}" />
              <Setter Property="Background" TargetName="Border" Value="{StaticResource ScrollOverOutterBackgroundBrush}" />
              <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ScrollOverInnerBorderBrush}" />
              <Setter Property="Background" TargetName="border" Value="{StaticResource ScrollOverInnerBackgroundBrush}" />
            </MultiTrigger>
            <Trigger Property="IsPressed" Value="true">
              <Setter Property="BorderBrush" TargetName="Border" Value="{StaticResource ScrollPressedOutterBorderBrush}" />
              <Setter Property="Background" TargetName="Border" Value="{StaticResource ScrollPressedOutterBackgroundBrush}" />
              <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ScrollPressedInnerBorderBrush}" />
              <Setter Property="Background" TargetName="border" Value="{StaticResource ScrollPressedInnerBackgroundBrush}" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
              <Setter Property="Opacity" TargetName="path" Value="0.5" />
              <Setter Property="Background" TargetName="Border" Value="{StaticResource TransparentBrush}" />
              <Setter Property="BorderBrush" TargetName="Border" Value="{StaticResource TransparentBrush}" />
              <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource TransparentBrush}" />
              <Setter Property="Background" TargetName="border" Value="{StaticResource TransparentBrush}" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="Foreground">
      <Setter.Value>
        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
          <GradientStop Color="#FF747576" Offset="0" />
          <GradientStop Color="#FF454647" Offset="1" />
        </LinearGradientBrush>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
    <Setter Property="SnapsToDevicePixels" Value="True" />
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="IsTabStop" Value="false" />
    <Setter Property="Focusable" Value="false" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Thumb}">
          <Border x:Name="border" CornerRadius="1" BorderThickness="1" Background="{StaticResource ScrollOutterBackgroundBrush}" BorderBrush="{StaticResource ScrollOutterBorderBrush}">
            <Border x:Name="border1" Width="Auto" BorderBrush="{StaticResource ScrollInnerBorderBrush}" BorderThickness="1" CornerRadius="1" Background="{StaticResource ScrollInnerBackgroundBrush}" Padding="2" ClipToBounds="True">
              <StackPanel Width="Auto" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" Height="8" Visibility="Visible">
                <Rectangle Stroke="#66000000" Width="1" Margin="0" Height="Auto" HorizontalAlignment="Left" />
                <Rectangle Stroke="#66F8F8F8" Width="1" Margin="0,2,0,0" Height="Auto" HorizontalAlignment="Left" />
                <Rectangle Stroke="#66000000" Width="1" Margin="0" Height="Auto" HorizontalAlignment="Left" />
                <Rectangle Stroke="#66F8F8F8" Width="1" Margin="0,2,0,0" Height="Auto" HorizontalAlignment="Left" />
                <Rectangle Stroke="#66000000" Width="1" Margin="0" Height="Auto" HorizontalAlignment="Left" />
                <Rectangle Stroke="#66F8F8F8" Width="1" Margin="0,2,0,0" Height="Auto" HorizontalAlignment="Left" />
                <Rectangle Stroke="#66000000" Width="1" Margin="0" Height="Auto" HorizontalAlignment="Left" />
                <Rectangle Stroke="#66F8F8F8" Width="1" Margin="0,2,0,0" Height="Auto" HorizontalAlignment="Left" />
              </StackPanel>
            </Border>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsDragging" Value="True">
              <Setter Property="Background" TargetName="border" Value="{StaticResource ScrollPressedOutterBackgroundBrush}" />
              <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ScrollPressedOutterBorderBrush}" />
              <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ScrollPressedInnerBorderBrush}" />
              <Setter Property="Background" TargetName="border1" Value="{StaticResource ScrollPressedInnerBackgroundBrush}" />
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True">
              <Setter Property="Background" TargetName="border" Value="{StaticResource ScrollOverOutterBackgroundBrush}" />
              <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ScrollOverOutterBorderBrush}" />
              <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ScrollOverInnerBorderBrush}" />
              <Setter Property="Background" TargetName="border1" Value="{StaticResource ScrollOverInnerBackgroundBrush}" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="VerticalScrollBarLineButton" TargetType="{x:Type RepeatButton}">
    <Setter Property="SnapsToDevicePixels" Value="True" />
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="Focusable" Value="false" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type RepeatButton}">
          <Border Name="Border" Margin="0" CornerRadius="1" BorderThickness="1" BorderBrush="{StaticResource ScrollVerticalOutterBorderBrush}" Background="{StaticResource ScrollVerticalOutterBackgroundBrush}">
            <Border x:Name="border" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" CornerRadius="1" BorderThickness="1" BorderBrush="{StaticResource ScrollVerticalInnerBorderBrush}" Background="{StaticResource ScrollVerticalInnerBackgroundBrush}">
              <Path x:Name="path" Data="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}" Width="Auto" Height="Auto" HorizontalAlignment="Center" VerticalAlignment="Center" Fill="{TemplateBinding Foreground}" />
            </Border>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="Panel.Background" Value="White">
              <Setter Property="Background" TargetName="Border" Value="{StaticResource TransparentBrush}" />
              <Setter Property="BorderBrush" TargetName="Border" Value="{StaticResource TransparentBrush}" />
              <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource TransparentBrush}" />
              <Setter Property="Background" TargetName="border" Value="{StaticResource TransparentBrush}" />
            </Trigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsMouseOver" Value="True" />
                <Condition Property="IsPressed" Value="False" />
              </MultiTrigger.Conditions>
              <Setter Property="BorderBrush" TargetName="Border" Value="{StaticResource ScrollVerticalOverOutterBorderBrush}" />
              <Setter Property="Background" TargetName="Border" Value="{StaticResource ScrollVerticalOverOutterBackgroundBrush}" />
              <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ScrollVerticalOverInnerBorderBrush}" />
              <Setter Property="Background" TargetName="border" Value="{StaticResource ScrollVerticalOverInnerBackgroundBrush}" />
            </MultiTrigger>
            <Trigger Property="IsPressed" Value="true">
              <Setter Property="BorderBrush" TargetName="Border" Value="{StaticResource ScrollVerticalPressedOutterBorderBrush}" />
              <Setter Property="Background" TargetName="Border" Value="{StaticResource ScrollVerticalPressedOutterBackgroundBrush}" />
              <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ScrollVerticalPressedInnerBorderBrush}" />
              <Setter Property="Background" TargetName="border" Value="{StaticResource ScrollVerticalPressedInnerBackgroundBrush}" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
              <Setter Property="Opacity" TargetName="path" Value="0.5" />
              <Setter Property="Background" TargetName="Border" Value="{StaticResource TransparentBrush}" />
              <Setter Property="BorderBrush" TargetName="Border" Value="{StaticResource TransparentBrush}" />
              <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource TransparentBrush}" />
              <Setter Property="Background" TargetName="border" Value="{StaticResource TransparentBrush}" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="Foreground">
      <Setter.Value>
        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
          <GradientStop Color="#FF747576" Offset="0" />
          <GradientStop Color="#FF454647" Offset="1" />
        </LinearGradientBrush>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="VerticalScrollBarThumb" TargetType="{x:Type Thumb}">
    <Setter Property="SnapsToDevicePixels" Value="True" />
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="IsTabStop" Value="false" />
    <Setter Property="Focusable" Value="false" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Thumb}">
          <Border x:Name="border" CornerRadius="1" BorderThickness="1" Background="{StaticResource ScrollVerticalOutterBackgroundBrush}" BorderBrush="{StaticResource ScrollVerticalOutterBorderBrush}">
            <Border x:Name="border1" Width="Auto" BorderBrush="{StaticResource ScrollVerticalInnerBorderBrush}" BorderThickness="1" CornerRadius="1" Background="{StaticResource ScrollVerticalInnerBackgroundBrush}" Padding="2" ClipToBounds="True">
              <StackPanel Width="8" Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Center" Height="Auto" Visibility="Visible">
                <Rectangle Stroke="#66000000" Width="Auto" Margin="0" Height="1" />
                <Rectangle Stroke="#66F8F8F8" Width="Auto" Margin="2,0,0,0" Height="1" />
                <Rectangle Stroke="#66000000" Width="Auto" Margin="0" Height="1" />
                <Rectangle Stroke="#66F8F8F8" Width="Auto" Margin="2,0,0,0" Height="1" />
                <Rectangle Stroke="#66000000" Width="Auto" Margin="0" Height="1" />
                <Rectangle Stroke="#66F8F8F8" Width="Auto" Margin="2,0,0,0" Height="1" />
                <Rectangle Stroke="#66000000" Width="Auto" Margin="0" Height="1" />
                <Rectangle Stroke="#66F8F8F8" Width="Auto" Margin="2,0,0,0" Height="1" />
              </StackPanel>
            </Border>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsDragging" Value="True">
              <Setter Property="Background" TargetName="border" Value="{StaticResource ScrollVerticalPressedOutterBackgroundBrush}" />
              <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ScrollVerticalPressedOutterBorderBrush}" />
              <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ScrollVerticalPressedInnerBorderBrush}" />
              <Setter Property="Background" TargetName="border1" Value="{StaticResource ScrollVerticalPressedInnerBackgroundBrush}" />
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True">
              <Setter Property="Background" TargetName="border" Value="{StaticResource ScrollVerticalOverOutterBackgroundBrush}" />
              <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ScrollVerticalOverOutterBorderBrush}" />
              <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ScrollVerticalOverInnerBorderBrush}" />
              <Setter Property="Background" TargetName="border1" Value="{StaticResource ScrollVerticalOverInnerBackgroundBrush}" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <ControlTemplate x:Key="VerticalScrollBar" TargetType="{x:Type ScrollBar}">
    <Grid>
      <Grid.RowDefinitions>
        <RowDefinition MaxHeight="18" />
        <RowDefinition Height="0.00001*" />
        <RowDefinition MaxHeight="18" />
      </Grid.RowDefinitions>
      <Border Grid.RowSpan="3" CornerRadius="0" Background="{StaticResource ScrollVerticalBackgroundBrush}" />
      <RepeatButton x:Name="repeatButton" Grid.Row="0" Style="{StaticResource VerticalScrollBarLineButton}" Height="17" Command="ScrollBar.LineUpCommand" Content="M 0 4 L 8 4 L 4 0 Z" VerticalAlignment="Top" Margin="1,1,1,0" Background="White" />
      <Track Name="PART_Track" Grid.Row="1" IsDirectionReversed="true" ViewportSize="{TemplateBinding ViewportSize}">
        <Track.Resources>
          <!-- Set the Thumb's minimum height to 50.
                      The Thumb's minimum height is half the
                      value of VerticalScrollBarButtonHeightKey. -->
          <System:Double x:Key="{x:Static SystemParameters.VerticalScrollBarButtonHeightKey}">
              36
            </System:Double>
        </Track.Resources>
        <Track.DecreaseRepeatButton>
          <RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageUpCommand" />
        </Track.DecreaseRepeatButton>
        <Track.Thumb>
          <Thumb Style="{StaticResource VerticalScrollBarThumb}" Margin="1,0,1,0" RenderTransformOrigin="0.5,0.5" />
        </Track.Thumb>
        <Track.IncreaseRepeatButton>
          <RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageDownCommand" />
        </Track.IncreaseRepeatButton>
      </Track>
      <RepeatButton x:Name="repeatButton1" Grid.Row="3" Style="{StaticResource VerticalScrollBarLineButton}" Height="17" Command="ScrollBar.LineDownCommand" Content="M 0 0 L 4 4 L 8 0 Z" Margin="1,0,1,1" Background="White" />
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="IsMouseOver" Value="True">
        <Setter Property="Background" TargetName="repeatButton" Value="{x:Null}" />
        <Setter Property="Background" TargetName="repeatButton1" Value="{x:Null}" />
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <ControlTemplate x:Key="HorizontalScrollBar" TargetType="{x:Type ScrollBar}">
    <Grid>
      <Grid.ColumnDefinitions>
        <ColumnDefinition MaxWidth="18" />
        <ColumnDefinition Width="0.00001*" />
        <ColumnDefinition MaxWidth="18" />
      </Grid.ColumnDefinitions>
      <Border Grid.ColumnSpan="3" CornerRadius="0" Margin="0" Background="{StaticResource ScrollBackgroundBrush}" />
      <RepeatButton x:Name="repeatButton" Grid.Column="0" Style="{StaticResource ScrollBarLineButton}" Width="17" Command="ScrollBar.LineLeftCommand" Content="M 4 0 L 4 8 L 0 4 Z" Margin="1,1,0,1" Background="White" />
      <Track Name="PART_Track" Grid.Column="1" IsDirectionReversed="False" Margin="0,0,0,1" ViewportSize="{TemplateBinding ViewportSize}">
        <Track.Resources>
          <!-- Set the Thumb's minimum height to 50.
                      The Thumb's minimum height is half the
                      value of VerticalScrollBarButtonHeightKey. -->
          <System:Double x:Key="{x:Static SystemParameters.HorizontalScrollBarButtonWidthKey}">
              36
            </System:Double>
        </Track.Resources>
        <Track.DecreaseRepeatButton>
          <RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageLeftCommand" />
        </Track.DecreaseRepeatButton>
        <Track.Thumb>
          <Thumb Style="{StaticResource ScrollBarThumb}" Margin="0,0,0,0" />
        </Track.Thumb>
        <Track.IncreaseRepeatButton>
          <RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageRightCommand" />
        </Track.IncreaseRepeatButton>
      </Track>
      <RepeatButton x:Name="repeatButton1" Grid.Column="3" Style="{StaticResource ScrollBarLineButton}" Width="17" Command="ScrollBar.LineRightCommand" Content="M 0 0 L 4 4 L 0 8 Z" Margin="0,1,1,1" Background="White" />
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="IsMouseOver" Value="True">
        <Setter Property="Background" TargetName="repeatButton" Value="{x:Null}" />
        <Setter Property="Background" TargetName="repeatButton1" Value="{x:Null}" />
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <Style TargetType="ScrollBar">
    <Setter Property="SnapsToDevicePixels" Value="True" />
    <Style.Triggers>
      <Trigger Property="Orientation" Value="Horizontal">
        <Setter Property="Width" Value="Auto" />
        <Setter Property="Template" Value="{StaticResource HorizontalScrollBar}" />
        <Setter Property="Height" Value="17" />
      </Trigger>
      <Trigger Property="Orientation" Value="Vertical">
        <Setter Property="Height" Value="Auto" />
        <Setter Property="Template" Value="{StaticResource VerticalScrollBar}" />
        <Setter Property="Width" Value="17" />
      </Trigger>
    </Style.Triggers>
  </Style>
  <Style x:Key="ScrollBarWhiteLineButton" TargetType="{x:Type RepeatButton}">
    <Setter Property="SnapsToDevicePixels" Value="True" />
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="Focusable" Value="false" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type RepeatButton}">
          <Border Name="Border" Margin="0" CornerRadius="1" BorderThickness="1" BorderBrush="{StaticResource ScrollWhiteOutterBorderBrush}" Background="{StaticResource ScrollWhiteOutterBackgroundBrush}">
            <Border x:Name="border" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" CornerRadius="1" BorderThickness="1" BorderBrush="{StaticResource ScrollWhiteInnerBorderBrush}" Background="{StaticResource ScrollWhiteInnerBackgroundBrush}">
              <Path x:Name="path" Data="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}" Width="Auto" Height="Auto" HorizontalAlignment="Center" VerticalAlignment="Center" Fill="{TemplateBinding Foreground}" />
            </Border>
          </Border>
          <ControlTemplate.Triggers>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsMouseOver" Value="True" />
                <Condition Property="IsPressed" Value="False" />
              </MultiTrigger.Conditions>
              <Setter Property="BorderBrush" TargetName="Border" Value="{StaticResource ScrollWhiteOverOutterBorderBrush}" />
              <Setter Property="Background" TargetName="Border" Value="{StaticResource ScrollWhiteOverOutterBackgroundBrush}" />
              <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ScrollWhiteOverInnerBorderBrush}" />
              <Setter Property="Background" TargetName="border" Value="{StaticResource ScrollWhiteOverInnerBackgroundBrush}" />
            </MultiTrigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="Panel.Background" Value="White" />
                <Condition Property="IsEnabled" Value="True" />
              </MultiTrigger.Conditions>
              <Setter Property="BorderBrush" TargetName="Border" Value="{StaticResource ScrollWhiteOverOutterBorderBrush}" />
              <Setter Property="Background" TargetName="Border" Value="{StaticResource ScrollWhiteOverOutterBackgroundBrush}" />
              <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ScrollWhiteOverInnerBorderBrush}" />
              <Setter Property="Background" TargetName="border" Value="{StaticResource ScrollWhiteOverInnerBackgroundBrush}" />
            </MultiTrigger>
            <Trigger Property="IsPressed" Value="true">
              <Setter Property="BorderBrush" TargetName="Border" Value="{StaticResource ScrollWhitePressedOutterBorderBrush}" />
              <Setter Property="Background" TargetName="Border" Value="{StaticResource ScrollWhitePressedOutterBackgroundBrush}" />
              <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ScrollWhitePressedInnerBorderBrush}" />
              <Setter Property="Background" TargetName="border" Value="{StaticResource ScrollWhitePressedInnerBackgroundBrush}" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
              <Setter Property="Opacity" TargetName="path" Value="0.5" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="Foreground">
      <Setter.Value>
        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
          <GradientStop Color="#FF747576" Offset="0" />
          <GradientStop Color="#FF454647" Offset="1" />
        </LinearGradientBrush>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="ScrollBarWhiteThumb" TargetType="{x:Type Thumb}">
    <Setter Property="SnapsToDevicePixels" Value="True" />
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="IsTabStop" Value="false" />
    <Setter Property="Focusable" Value="false" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Thumb}">
          <Border x:Name="border" CornerRadius="1" BorderThickness="1" Background="{StaticResource ScrollWhiteOutterBackgroundBrush}" BorderBrush="{StaticResource ScrollWhiteOutterBorderBrush}">
            <Border x:Name="border1" Width="Auto" BorderBrush="{StaticResource ScrollWhiteInnerBorderBrush}" BorderThickness="1" CornerRadius="1" Background="{StaticResource ScrollWhiteInnerBackgroundBrush}" Padding="2" ClipToBounds="True">
              <StackPanel Width="Auto" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" Height="7" Visibility="Visible">
                <Rectangle Stroke="#FF8F9297" Width="1" Margin="1,0" />
                <Rectangle Stroke="#FF8F9297" Margin="0,0,1,0" Width="1" />
                <Rectangle Stroke="#FF8F9297" Margin="0,0,1,0" Width="1" />
                <Rectangle Stroke="#FF8F9297" Margin="0,0,1,0" Width="1" />
              </StackPanel>
            </Border>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsDragging" Value="True">
              <Setter Property="Background" TargetName="border" Value="{StaticResource ScrollWhitePressedOutterBackgroundBrush}" />
              <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ScrollWhitePressedOutterBorderBrush}" />
              <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ScrollWhitePressedInnerBorderBrush}" />
              <Setter Property="Background" TargetName="border1" Value="{StaticResource ScrollWhitePressedInnerBackgroundBrush}" />
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True">
              <Setter Property="Background" TargetName="border" Value="{StaticResource ScrollWhiteOverOutterBackgroundBrush}" />
              <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ScrollWhiteOverOutterBorderBrush}" />
              <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ScrollWhiteOverInnerBorderBrush}" />
              <Setter Property="Background" TargetName="border1" Value="{StaticResource ScrollWhiteOverInnerBackgroundBrush}" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="VerticalScrollBarWhiteLineButton" TargetType="{x:Type RepeatButton}">
    <Setter Property="SnapsToDevicePixels" Value="True" />
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="Focusable" Value="false" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type RepeatButton}">
          <Border Name="Border" Margin="0" CornerRadius="1" BorderThickness="1" BorderBrush="{StaticResource ScrollWhiteVerticalOutterBorderBrush}" Background="{StaticResource ScrollWhiteVerticalOutterBackgroundBrush}">
            <Border x:Name="border" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" CornerRadius="1" BorderThickness="1" BorderBrush="{StaticResource ScrollWhiteVerticalInnerBorderBrush}" Background="{StaticResource ScrollWhiteVerticalInnerBackgroundBrush}">
              <Path x:Name="path" Data="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}" Width="Auto" Height="Auto" HorizontalAlignment="Center" VerticalAlignment="Center" Fill="{TemplateBinding Foreground}" />
            </Border>
          </Border>
          <ControlTemplate.Triggers>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsMouseOver" Value="True" />
                <Condition Property="IsPressed" Value="False" />
              </MultiTrigger.Conditions>
              <Setter Property="BorderBrush" TargetName="Border" Value="{StaticResource ScrollWhiteVerticalOverOutterBorderBrush}" />
              <Setter Property="Background" TargetName="Border" Value="{StaticResource ScrollWhiteVerticalOverOutterBackgroundBrush}" />
              <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ScrollWhiteVerticalOverInnerBorderBrush}" />
              <Setter Property="Background" TargetName="border" Value="{StaticResource ScrollWhiteVerticalOverInnerBackgroundBrush}" />
            </MultiTrigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="Panel.Background" Value="White" />
                <Condition Property="IsEnabled" Value="True" />
              </MultiTrigger.Conditions>
              <Setter Property="BorderBrush" TargetName="Border" Value="{StaticResource ScrollWhiteOverOutterBorderBrush}" />
              <Setter Property="Background" TargetName="Border" Value="{StaticResource ScrollWhiteOverOutterBackgroundBrush}" />
              <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ScrollWhiteOverInnerBorderBrush}" />
              <Setter Property="Background" TargetName="border" Value="{StaticResource ScrollWhiteOverInnerBackgroundBrush}" />
            </MultiTrigger>
            <Trigger Property="IsPressed" Value="true">
              <Setter Property="BorderBrush" TargetName="Border" Value="{StaticResource ScrollWhiteVerticalPressedOutterBorderBrush}" />
              <Setter Property="Background" TargetName="Border" Value="{StaticResource ScrollWhiteVerticalPressedOutterBackgroundBrush}" />
              <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ScrollWhiteVerticalPressedInnerBorderBrush}" />
              <Setter Property="Background" TargetName="border" Value="{StaticResource ScrollWhiteVerticalPressedInnerBackgroundBrush}" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
              <Setter Property="Opacity" TargetName="path" Value="0.5" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="Foreground">
      <Setter.Value>
        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
          <GradientStop Color="#FF747576" Offset="0" />
          <GradientStop Color="#FF454647" Offset="1" />
        </LinearGradientBrush>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="VerticalScrollBarWhiteThumb" TargetType="{x:Type Thumb}">
    <Setter Property="SnapsToDevicePixels" Value="True" />
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="IsTabStop" Value="false" />
    <Setter Property="Focusable" Value="false" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Thumb}">
          <Border x:Name="border" CornerRadius="1" BorderThickness="1" Background="{StaticResource ScrollWhiteVerticalOutterBackgroundBrush}" BorderBrush="{StaticResource ScrollWhiteVerticalOutterBorderBrush}">
            <Border x:Name="border1" Width="Auto" BorderBrush="{StaticResource ScrollWhiteVerticalInnerBorderBrush}" BorderThickness="1" CornerRadius="1" Background="{StaticResource ScrollWhiteVerticalInnerBackgroundBrush}" Padding="2" ClipToBounds="True">
              <StackPanel Width="7" Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Center" Height="Auto" Visibility="Visible">
                <Rectangle Stroke="#FF8F9297" Width="Auto" Margin="0,1" Height="1" />
                <Rectangle Stroke="#FF8F9297" Margin="0,0,0,1" Width="Auto" Height="1" />
                <Rectangle Stroke="#FF8F9297" Margin="0,0,0,1" Width="Auto" Height="1" />
                <Rectangle Stroke="#FF8F9297" Margin="0,0,0,1" Width="Auto" Height="1" />
              </StackPanel>
            </Border>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsDragging" Value="True">
              <Setter Property="Background" TargetName="border" Value="{StaticResource ScrollWhiteVerticalPressedOutterBackgroundBrush}" />
              <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ScrollWhiteVerticalPressedOutterBorderBrush}" />
              <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ScrollWhiteVerticalPressedInnerBorderBrush}" />
              <Setter Property="Background" TargetName="border1" Value="{StaticResource ScrollWhiteVerticalPressedInnerBackgroundBrush}" />
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True">
              <Setter Property="Background" TargetName="border" Value="{StaticResource ScrollWhiteVerticalOverOutterBackgroundBrush}" />
              <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ScrollWhiteVerticalOverOutterBorderBrush}" />
              <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ScrollWhiteVerticalOverInnerBorderBrush}" />
              <Setter Property="Background" TargetName="border1" Value="{StaticResource ScrollWhiteVerticalOverInnerBackgroundBrush}" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <ControlTemplate x:Key="VerticalScrollBarWhite" TargetType="{x:Type ScrollBar}">
    <Grid>
      <Grid.RowDefinitions>
        <RowDefinition MaxHeight="18" />
        <RowDefinition Height="0.00001*" />
        <RowDefinition MaxHeight="18" />
      </Grid.RowDefinitions>
      <Border Grid.RowSpan="3" CornerRadius="0" Background="{StaticResource ScrollWhiteVerticalBackgroundBrush}" />
      <RepeatButton x:Name="repeatButton" Grid.Row="0" Style="{StaticResource VerticalScrollBarWhiteLineButton}" Height="17" Command="ScrollBar.LineUpCommand" Content="M 0 4 L 8 4 L 4 0 Z" VerticalAlignment="Top" Margin="1,1,1,0" />
      <Track Name="PART_Track" Grid.Row="1" IsDirectionReversed="true" ViewportSize="{TemplateBinding ViewportSize}">
        <Track.Resources>
          <!-- Set the Thumb's minimum height to 50.
                      The Thumb's minimum height is half the
                      value of VerticalScrollBarButtonHeightKey. -->
          <System:Double x:Key="{x:Static SystemParameters.VerticalScrollBarButtonHeightKey}">
              36
            </System:Double>
        </Track.Resources>
        <Track.DecreaseRepeatButton>
          <RepeatButton Style="{StaticResource ScrollBarWhitePageButton}" Command="ScrollBar.PageUpCommand" />
        </Track.DecreaseRepeatButton>
        <Track.Thumb>
          <Thumb Style="{StaticResource VerticalScrollBarWhiteThumb}" Margin="1,0,1,0" RenderTransformOrigin="0.5,0.5" />
        </Track.Thumb>
        <Track.IncreaseRepeatButton>
          <RepeatButton Style="{StaticResource ScrollBarWhitePageButton}" Command="ScrollBar.PageDownCommand" />
        </Track.IncreaseRepeatButton>
      </Track>
      <RepeatButton x:Name="repeatButton1" Grid.Row="3" Style="{StaticResource VerticalScrollBarWhiteLineButton}" Height="17" Command="ScrollBar.LineDownCommand" Content="M 0 0 L 4 4 L 8 0 Z" Margin="1,0,1,1" />
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="IsMouseOver" Value="True">
        <Setter Property="Background" TargetName="repeatButton" Value="White" />
        <Setter Property="Background" TargetName="repeatButton1" Value="White" />
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <ControlTemplate x:Key="HorizontalScrollBarWhite" TargetType="{x:Type ScrollBar}">
    <Grid>
      <Grid.ColumnDefinitions>
        <ColumnDefinition MaxWidth="18" />
        <ColumnDefinition Width="0.00001*" />
        <ColumnDefinition MaxWidth="18" />
      </Grid.ColumnDefinitions>
      <Border Grid.ColumnSpan="3" CornerRadius="0" Margin="0" Background="{StaticResource ScrollWhiteBackgroundBrush}" />
      <RepeatButton x:Name="repeatButton1" Grid.Column="0" Style="{StaticResource ScrollBarWhiteLineButton}" Width="17" Command="ScrollBar.LineLeftCommand" Content="M 4 0 L 4 8 L 0 4 Z" Margin="1,1,0,1" />
      <Track Name="PART_Track" Grid.Column="1" IsDirectionReversed="False" Margin="0,0,0,1" ViewportSize="{TemplateBinding ViewportSize}">
        <Track.Resources>
          <!-- Set the Thumb's minimum height to 50.
                      The Thumb's minimum height is half the
                      value of VerticalScrollBarButtonHeightKey. -->
          <System:Double x:Key="{x:Static SystemParameters.HorizontalScrollBarButtonWidthKey}">
              36
            </System:Double>
        </Track.Resources>
        <Track.DecreaseRepeatButton>
          <RepeatButton Style="{StaticResource ScrollBarWhitePageButton}" Command="ScrollBar.PageLeftCommand" />
        </Track.DecreaseRepeatButton>
        <Track.Thumb>
          <Thumb Style="{StaticResource ScrollBarWhiteThumb}" Margin="0,0,0,0" />
        </Track.Thumb>
        <Track.IncreaseRepeatButton>
          <RepeatButton Style="{StaticResource ScrollBarWhitePageButton}" Command="ScrollBar.PageRightCommand" />
        </Track.IncreaseRepeatButton>
      </Track>
      <RepeatButton x:Name="repeatButton" Grid.Column="3" Style="{StaticResource ScrollBarWhiteLineButton}" Width="17" Command="ScrollBar.LineRightCommand" Content="M 0 0 L 4 4 L 0 8 Z" Margin="0,1,1,1" />
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="IsMouseOver" Value="True">
        <Setter Property="Background" TargetName="repeatButton" Value="White" />
        <Setter Property="Background" TargetName="repeatButton1" Value="White" />
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <Style x:Key="ScrollBarWhite" TargetType="{x:Type ScrollBar}">
    <Setter Property="SnapsToDevicePixels" Value="True" />
    <Style.Triggers>
      <Trigger Property="Orientation" Value="Horizontal">
        <Setter Property="Width" Value="Auto" />
        <Setter Property="Template" Value="{StaticResource HorizontalScrollBarWhite}" />
        <Setter Property="Height" Value="17" />
      </Trigger>
      <Trigger Property="Orientation" Value="Vertical">
        <Setter Property="Height" Value="Auto" />
        <Setter Property="Template" Value="{StaticResource VerticalScrollBarWhite}" />
        <Setter Property="Width" Value="17" />
      </Trigger>
    </Style.Triggers>
  </Style>
  <Style TargetType="{x:Type Fluent:TextBox}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Fluent:TextBox}">
          <Border Width="Auto" Background="#00000000" Height="22">
            <Grid Width="Auto" Height="Auto" Background="#00000000">
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition />
              </Grid.ColumnDefinitions>
              <StackPanel Orientation="Horizontal" Grid.ColumnSpan="1" x:Name="stackPanel" HorizontalAlignment="Left" Margin="0,0,4,0">
                <ContentPresenter x:Name="iconImage" Width="16" Height="16" VerticalAlignment="Center" Margin="3,0,0,0" Content="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource StringToImageConvert}}" />
                <TextBlock Text="{TemplateBinding Header}" TextWrapping="Wrap" VerticalAlignment="Center" Margin="5,0,0,0" x:Name="textBlock" />
              </StackPanel>
              <Border Height="Auto" BorderThickness="1,1,1,1" BorderBrush="{StaticResource TextBoxBorderBrush}" x:Name="PART_ContentBorder" Background="{StaticResource TextBoxBackgroundBrush}" Grid.Column="1" Grid.ColumnSpan="1" Width="{TemplateBinding InputWidth}" HorizontalAlignment="Right">
                <TextBox HorizontalAlignment="Stretch" VerticalAlignment="Stretch" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" TextWrapping="NoWrap" BorderThickness="0,0,0,0" x:Name="PART_TextBox" Background="{StaticResource TextBoxBackgroundBrush}" />
              </Border>
            </Grid>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="Icon" Value="{x:Null}">
              <Setter Property="Visibility" TargetName="iconImage" Value="Collapsed" />
            </Trigger>
            <Trigger Property="InputWidth" Value="NaN">
              <Setter Property="HorizontalAlignment" TargetName="PART_ContentBorder" Value="Stretch" />
            </Trigger>
            <Trigger Property="Size" Value="Middle">
              <Setter Property="Visibility" TargetName="textBlock" Value="Collapsed" />
            </Trigger>
            <Trigger Property="Size" Value="Small">
              <Setter Property="Visibility" TargetName="stackPanel" Value="Collapsed" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
              <Setter Property="IsEnabled" TargetName="PART_TextBox" Value="False" />
              <Setter Property="Background" TargetName="PART_ContentBorder" Value="{StaticResource TextBoxDisabledBackgroundBrush}" />
              <Setter Property="BorderBrush" TargetName="PART_ContentBorder" Value="{StaticResource TextBoxDisabledBorderBrush}" />
              <Setter Property="BorderBrush" TargetName="PART_TextBox" Value="{StaticResource TextBoxDisabledBackgroundBrush}" />
              <Setter Property="Opacity" TargetName="iconImage" Value="0.5" />
              <Setter Property="Opacity" TargetName="textBlock" Value="0.5" />
              <Setter Property="Effect" TargetName="iconImage">
                <Setter.Value>
                  <Fluent:GrayscaleEffect />
                </Setter.Value>
              </Setter>
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True">
              <Setter Property="BorderBrush" TargetName="PART_ContentBorder" Value="{StaticResource TextBoxHoverBorderBrush}" />
              <Setter Property="Background" TargetName="PART_TextBox" Value="{StaticResource TextBoxHoverBackgroundBrush}" />
              <Setter Property="Background" TargetName="PART_ContentBorder" Value="{StaticResource TextBoxHoverBackgroundBrush}" />
            </Trigger>
            <Trigger Property="IsKeyboardFocusWithin" Value="True">
              <Setter Property="BorderBrush" TargetName="PART_ContentBorder" Value="{StaticResource TextBoxHoverBorderBrush}" />
              <Setter Property="Background" TargetName="PART_TextBox" Value="{StaticResource TextBoxHoverBackgroundBrush}" />
              <Setter Property="Background" TargetName="PART_ContentBorder" Value="{StaticResource TextBoxHoverBackgroundBrush}" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlStyleEmptyFocus}" />
  </Style>
  <ContextMenu x:Key="TextBoxContextMenu" x:Shared="False">
    <ContextMenu.Resources>
      <BitmapImage x:Key="MenuCutIcon" UriSource="pack://application:,,,/Fluent;component/Themes\Office2010\Images\Cut.png" PresentationOptions:Freeze="True" />
      <BitmapImage x:Key="MenuCopyIcon" UriSource="pack://application:,,,/Fluent;component/Themes\Office2010\Images\Copy.png" PresentationOptions:Freeze="True" />
      <BitmapImage x:Key="MenuPasteIcon" UriSource="pack://application:,,,/Fluent;component/Themes\Office2010\Images\Paste.png" PresentationOptions:Freeze="True" />
    </ContextMenu.Resources>
    <Fluent:MenuItem Icon="{StaticResource MenuCutIcon}" Command="ApplicationCommands.Cut" CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}" />
    <Fluent:MenuItem Icon="{StaticResource MenuCopyIcon}" Command="ApplicationCommands.Copy" CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}" />
    <Fluent:MenuItem Icon="{StaticResource MenuPasteIcon}" Command="ApplicationCommands.Paste" CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}" />
  </ContextMenu>
  <ControlTemplate x:Key="SpinnerButtonControlTemplate" TargetType="{x:Type RepeatButton}">
    <Border x:Name="border" BorderThickness="1" CornerRadius="2" Background="{StaticResource TransparentBrush}" BorderBrush="{StaticResource TransparentBrush}" Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
      <Border x:Name="border1" Height="Auto" BorderBrush="{StaticResource TransparentBrush}" BorderThickness="1" CornerRadius="2" Background="{StaticResource TransparentBrush}">
        <Grid Height="Auto">
          <Rectangle x:Name="rectangle" StrokeThickness="0" Visibility="Collapsed">
            <Rectangle.Fill>
              <RadialGradientBrush Center="0.503,1" GradientOrigin="0.503,1" RadiusY="0.202">
                <GradientStop Color="#7FFFFFFF" Offset="0" />
                <GradientStop Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <ContentPresenter x:Name="contentPresenter" HorizontalAlignment="Center" VerticalAlignment="Center" />
        </Grid>
      </Border>
    </Border>
    <ControlTemplate.Triggers>
      <Trigger Property="IsMouseOver" Value="False" />
      <Trigger Property="IsPressed" Value="True">
        <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonPressedOuterBorderBrush}" />
        <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonPressedOuterBackgroundBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonPressedInnerBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonPressedInnerBorderBrush}" />
      </Trigger>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="Opacity" TargetName="contentPresenter" Value="0.5" />
      </Trigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsMouseOver" Value="True" />
          <Condition Property="IsPressed" Value="False" />
        </MultiTrigger.Conditions>
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
        <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
        <Setter Property="Visibility" TargetName="rectangle" Value="Visible" />
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsKeyboardFocusWithin" Value="True" />
          <Condition Property="IsPressed" Value="False" />
        </MultiTrigger.Conditions>
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
        <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
      </MultiTrigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <Style x:Key="SpinnerButtonStyle" TargetType="{x:Type RepeatButton}">
    <Setter Property="Template" Value="{StaticResource SpinnerButtonControlTemplate}" />
    <Setter Property="Foreground" Value="{StaticResource DefaultFontBrush}" />
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlStyleEmptyFocus}" />
  </Style>
  <Style x:Key="SpinnerStyle" TargetType="{x:Type Fluent:Spinner}">
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlStyleEmptyFocus}" />
    <Setter Property="Foreground" Value="{StaticResource DefaultFontBrush}" />
    <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}" />
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
    <Setter Property="Focusable" Value="False" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Fluent:Spinner}">
          <Grid Width="Auto" Height="22" Background="#00000000">
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="Auto" />
              <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <StackPanel Orientation="Horizontal" Grid.ColumnSpan="1" x:Name="stackPanel" HorizontalAlignment="Left" Margin="0,0,3,0">
              <ContentPresenter x:Name="iconImage" Width="16" Height="16" VerticalAlignment="Center" Margin="4,0,0,0" Content="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource StringToImageConvert}}" />
              <TextBlock Text="{TemplateBinding Header}" TextWrapping="Wrap" VerticalAlignment="Center" Margin="5,0,4,0" x:Name="textBlock" />
            </StackPanel>
            <Border x:Name="border" Height="22" BorderThickness="1" BorderBrush="{StaticResource TextBoxBorderBrush}" Background="{StaticResource TextBoxBackgroundBrush}" Grid.ColumnSpan="1" Grid.Column="1" Width="{TemplateBinding InputWidth}" HorizontalAlignment="Right">
              <Grid Grid.ColumnSpan="1" Grid.Column="1">
                <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="*" />
                  <ColumnDefinition Width="17" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                  <RowDefinition Height="*" />
                  <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <TextBox x:Name="PART_TextBox" BorderThickness="0" Grid.RowSpan="2" Grid.Column="0" Background="{StaticResource TextBoxBackgroundBrush}" Foreground="{TemplateBinding Foreground}" Padding="2,0,2,0" Margin="0" />
                <Path Visibility="Collapsed" HorizontalAlignment="Left" Margin="0,-1,0,-1" x:Name="path" Width="1" Fill="#FF000000" Stretch="Fill" Stroke="{StaticResource TextBoxHoverBorderBrush}" StrokeThickness="1" Grid.Column="1" Grid.RowSpan="2" Data="M0,0L0,1" />
                <Path HorizontalAlignment="Left" Margin="0,0,-1,0" Width="Auto" Fill="#FF000000" Stretch="Fill" Stroke="{StaticResource TextBoxHoverBorderBrush}" StrokeThickness="1" Data="M0,0L1,0" Visibility="Collapsed" x:Name="path1" VerticalAlignment="Bottom" Height="1" Grid.Column="1" Grid.RowSpan="1" />
                <RepeatButton x:Name="PART_ButtonUp" Grid.Column="1" Grid.Row="0" Style="{StaticResource SpinnerButtonStyle}" RenderTransformOrigin="0,0.5" HorizontalAlignment="Stretch">
                  <Path Width="5" Height="3" Fill="#FF000000" Stretch="Fill" Stroke="#FF000000" Data="M0,0L1,-1 2,0" HorizontalAlignment="Center" StrokeThickness="0" VerticalAlignment="Center" Margin="1,2,0,1" RenderOptions.EdgeMode="Aliased" />
                </RepeatButton>
                <RepeatButton x:Name="PART_ButtonDown" Grid.Column="1" Grid.Row="1" Style="{StaticResource SpinnerButtonStyle}">
                  <Path Width="5" Height="3" Fill="#FF000000" Stretch="Fill" Stroke="#FF000000" Data="M0,0L1,1 2,0" StrokeThickness="0" HorizontalAlignment="Center" Margin="1,-1,0,0" VerticalAlignment="Center" RenderOptions.EdgeMode="Aliased" />
                </RepeatButton>
              </Grid>
            </Border>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="Icon" Value="{x:Null}">
              <Setter Property="Visibility" TargetName="iconImage" Value="Collapsed" />
            </Trigger>
            <Trigger Property="InputWidth" Value="NaN">
              <Setter Property="HorizontalAlignment" TargetName="border" Value="Stretch" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
              <Setter Property="IsEnabled" TargetName="PART_TextBox" Value="False" />
              <Setter Property="Background" TargetName="border" Value="{StaticResource TextBoxDisabledBackgroundBrush}" />
              <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource TextBoxDisabledBorderBrush}" />
              <Setter Property="Background" TargetName="PART_TextBox" Value="{StaticResource TextBoxDisabledBackgroundBrush}" />
              <Setter Property="Opacity" TargetName="iconImage" Value="0.5" />
              <Setter Property="Opacity" TargetName="textBlock" Value="0.5" />
              <Setter Property="Effect" TargetName="iconImage">
                <Setter.Value>
                  <Fluent:GrayscaleEffect />
                </Setter.Value>
              </Setter>
            </Trigger>
            <Trigger Property="Size" Value="Middle">
              <Setter Property="Visibility" TargetName="textBlock" Value="Collapsed" />
            </Trigger>
            <Trigger Property="Size" Value="Small">
              <Setter Property="Visibility" TargetName="stackPanel" Value="Collapsed" />
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True">
              <Setter Property="Visibility" TargetName="path" Value="Visible" />
              <Setter Property="Visibility" TargetName="path1" Value="Visible" />
              <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource TextBoxHoverBorderBrush}" />
              <Setter Property="Background" TargetName="border" Value="{StaticResource TextBoxHoverBackgroundBrush}" />
              <Setter Property="Background" TargetName="PART_TextBox" Value="{StaticResource TextBoxHoverBackgroundBrush}" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <ControlTemplate x:Key="RibbonComboButtonControlTemplate" TargetType="{x:Type Fluent:ToggleButton}">
    <Border x:Name="border" BorderThickness="1" CornerRadius="0" Background="{StaticResource ButtonBackgroundBrush}" BorderBrush="{StaticResource ButtonBorderBrush}" Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
      <Border x:Name="border1" Height="Auto" BorderBrush="{StaticResource TransparentBrush}" BorderThickness="1" CornerRadius="0" Background="{StaticResource TransparentBrush}">
        <Grid Height="Auto" HorizontalAlignment="Right">
          <Rectangle x:Name="rectangle" StrokeThickness="0" Visibility="Collapsed">
            <Rectangle.Fill>
              <RadialGradientBrush Center="0.503,1" GradientOrigin="0.503,1" RadiusY="0.202">
                <GradientStop Color="#7FFFFFFF" Offset="0" />
                <GradientStop Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Path x:Name="path" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M0,0L2,0 1,1z" Fill="{StaticResource DefaultFontBrush}" Margin="3,0,3,0" StrokeStartLineCap="Round" Stretch="Fill" StrokeEndLineCap="Round" Stroke="{StaticResource DefaultFontBrush}" StrokeThickness="1" StrokeMiterLimit="10" StrokeLineJoin="Round" Width="5" Height="4" StrokeDashCap="Round" IsHitTestVisible="False" />
        </Grid>
      </Border>
    </Border>
    <ControlTemplate.Triggers>
      <Trigger Property="IsPressed" Value="True">
        <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonPressedOuterBorderBrush}" />
        <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonPressedOuterBackgroundBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonPressedInnerBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonPressedInnerBorderBrush}" />
      </Trigger>
      <Trigger Property="IsChecked" Value="True">
        <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonPressedOuterBorderBrush}" />
        <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonPressedInnerBorderBrush}" />
      </Trigger>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="Opacity" TargetName="path" Value="0.5" />
      </Trigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsMouseOver" Value="True" />
          <Condition Property="IsPressed" Value="False" />
          <Condition Property="IsChecked" Value="False" />
        </MultiTrigger.Conditions>
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
        <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
        <Setter Property="Visibility" TargetName="rectangle" Value="Visible" />
      </MultiTrigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <GroupStyle x:Key="ComboBoxGroupStyle">
    <GroupStyle.ContainerStyle>
      <Style TargetType="{x:Type GroupItem}">
        <Setter Property="Template">
          <Setter.Value>
            <ControlTemplate TargetType="{x:Type GroupItem}">
              <Grid>
                <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="Auto" />
                  <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Grid Height="21" Background="#FFF0F2F5" Grid.ColumnSpan="2" VerticalAlignment="Top">
                  <TextBlock Margin="7,0" Text="{Binding Name}" VerticalAlignment="Center" HorizontalAlignment="Left" FontWeight="Bold" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" />
                </Grid>
                <Image Grid.Column="0" Stretch="None" Margin="4,21,4,0" VerticalAlignment="Top" HorizontalAlignment="Center" x:Name="iconImage">
                  <Image.Source>
                    <MultiBinding Converter="{StaticResource GroupIconConverter}">
                      <Binding Path="Items" />
                      <Binding ElementName="layoutRoot" />
                    </MultiBinding>
                  </Image.Source>
                </Image>
                <Path Fill="{x:Null}" Stretch="Fill" Stroke="#FFE2E4E7" HorizontalAlignment="Right" Width="1" Height="Auto" Data="M0,0L0,1" Visibility="Visible" x:Name="menuLine" Margin="0,21,0,0" />
                <ItemsPresenter Grid.Column="1" Margin="0,21,0,0" />
              </Grid>
              <ControlTemplate.Triggers>
                <Trigger SourceName="iconImage" Property="Source" Value="{x:Null}">
                  <Setter TargetName="menuLine" Property="Visibility" Value="Collapsed" />
                  <Setter TargetName="iconImage" Property="Visibility" Value="Collapsed" />
                </Trigger>
              </ControlTemplate.Triggers>
            </ControlTemplate>
          </Setter.Value>
        </Setter>
      </Style>
    </GroupStyle.ContainerStyle>
  </GroupStyle>
  <Style x:Key="ColorGalleryListBox" TargetType="{x:Type ListBox}">
    <Setter Property="Background" Value="{StaticResource GalleryBackgroundBrush}" />
    <Setter Property="ItemTemplate">
      <Setter.Value>
        <DataTemplate>
          <Rectangle Stroke="{StaticResource RibbonTopBorderBrush}">
            <Rectangle.Fill>
              <SolidColorBrush Color="{Binding}" />
            </Rectangle.Fill>
          </Rectangle>
        </DataTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ListBox}">
          <Border Background="{TemplateBinding Background}" HorizontalAlignment="Stretch">
            <UniformGrid Rows="1" HorizontalAlignment="Left" IsItemsHost="True" Columns="{Binding Columns, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:ColorGallery}}}" />
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="ItemContainerStyle">
      <Setter.Value>
        <Style TargetType="{x:Type ListBoxItem}">
          <Setter Property="Template">
            <Setter.Value>
              <ControlTemplate TargetType="{x:Type ListBoxItem}">
                <Grid Background="Transparent">
                  <ContentPresenter Margin="2" Width="{Binding ChipWidth, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:ColorGallery}}, FallbackValue=13}" Height="{Binding ChipHeight, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:ColorGallery}}, FallbackValue=13}" />
                  <Border BorderThickness="1" BorderBrush="{StaticResource ButtonHoverOuterBorderBrush}" x:Name="hoverBorder" Visibility="Collapsed" Margin="2">
                    <Border BorderThickness="1" BorderBrush="{StaticResource ButtonHoverInnerBorderBrush}" />
                  </Border>
                  <Border BorderThickness="1" BorderBrush="{StaticResource ButtonPressedOuterBorderBrush}" x:Name="selectedBorder" Visibility="Collapsed" Margin="2">
                    <Border BorderThickness="1" BorderBrush="{StaticResource ButtonPressedInnerBorderBrush}" />
                  </Border>
                </Grid>
                <ControlTemplate.Triggers>
                  <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Visibility" Value="Visible" TargetName="hoverBorder" />
                  </Trigger>
                  <Trigger Property="IsSelected" Value="True">
                    <Setter Property="Visibility" Value="Visible" TargetName="selectedBorder" />
                  </Trigger>
                </ControlTemplate.Triggers>
              </ControlTemplate>
            </Setter.Value>
          </Setter>
        </Style>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="HightlightColorGalleryListBox" TargetType="{x:Type ListBox}">
    <Setter Property="Background" Value="{StaticResource GalleryBackgroundBrush}" />
    <Setter Property="ItemTemplate">
      <Setter.Value>
        <DataTemplate>
          <Rectangle Stroke="{StaticResource RibbonTopBorderBrush}">
            <Rectangle.Fill>
              <SolidColorBrush Color="{Binding}" />
            </Rectangle.Fill>
          </Rectangle>
        </DataTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ListBox}">
          <Border Background="{TemplateBinding Background}" HorizontalAlignment="Stretch">
            <UniformGrid HorizontalAlignment="Left" IsItemsHost="True" Columns="{Binding Columns, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:ColorGallery}}}" />
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="ItemContainerStyle">
      <Setter.Value>
        <Style TargetType="{x:Type ListBoxItem}">
          <Setter Property="Template">
            <Setter.Value>
              <ControlTemplate TargetType="{x:Type ListBoxItem}">
                <Grid Background="Transparent">
                  <ContentPresenter Margin="2" Width="{Binding ChipWidth, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:ColorGallery}}, FallbackValue=13}" Height="{Binding ChipHeight, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:ColorGallery}}, FallbackValue=13}" />
                  <Border BorderThickness="1" BorderBrush="{StaticResource ButtonHoverOuterBorderBrush}" x:Name="hoverBorder" Visibility="Collapsed" Margin="2">
                    <Border BorderThickness="1" BorderBrush="{StaticResource ButtonHoverInnerBorderBrush}" />
                  </Border>
                  <Border BorderThickness="1" BorderBrush="{StaticResource ButtonPressedOuterBorderBrush}" x:Name="selectedBorder" Visibility="Collapsed" Margin="2">
                    <Border BorderThickness="1" BorderBrush="{StaticResource ButtonPressedInnerBorderBrush}" />
                  </Border>
                </Grid>
                <ControlTemplate.Triggers>
                  <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Visibility" Value="Visible" TargetName="hoverBorder" />
                  </Trigger>
                  <Trigger Property="IsSelected" Value="True">
                    <Setter Property="Visibility" Value="Visible" TargetName="selectedBorder" />
                  </Trigger>
                </ControlTemplate.Triggers>
              </ControlTemplate>
            </Setter.Value>
          </Setter>
        </Style>
      </Setter.Value>
    </Setter>
  </Style>
  <DataTemplate x:Key="GradientColorCenterDataTemplate">
    <Border BorderBrush="{StaticResource RibbonTopBorderBrush}" BorderThickness="1,0,1,0">
      <Border.Background>
        <SolidColorBrush Color="{Binding}" />
      </Border.Background>
    </Border>
  </DataTemplate>
  <DataTemplate x:Key="GradientColorTopDataTemplate">
    <Border BorderBrush="{StaticResource RibbonTopBorderBrush}" BorderThickness="1,1,1,0">
      <Border.Background>
        <SolidColorBrush Color="{Binding}" />
      </Border.Background>
    </Border>
  </DataTemplate>
  <DataTemplate x:Key="GradientColorBottomDataTemplate">
    <Border BorderBrush="{StaticResource RibbonTopBorderBrush}" BorderThickness="1,0,1,1">
      <Border.Background>
        <SolidColorBrush Color="{Binding}" />
      </Border.Background>
    </Border>
  </DataTemplate>
  <Style x:Key="ColorGalleryGradientListBox" TargetType="{x:Type ListBox}">
    <Setter Property="Background" Value="{StaticResource GalleryBackgroundBrush}" />
    <Setter Property="ItemTemplateSelector" Value="{StaticResource ColorGradientItemTemplateSelect}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ListBox}">
          <Border Background="{TemplateBinding Background}" HorizontalAlignment="Stretch">
            <UniformGrid HorizontalAlignment="Left" IsItemsHost="True" Columns="{Binding Columns, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:ColorGallery}}}" />
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="ItemContainerStyle">
      <Setter.Value>
        <Style TargetType="{x:Type ListBoxItem}">
          <Setter Property="Template">
            <Setter.Value>
              <ControlTemplate TargetType="{x:Type ListBoxItem}">
                <Grid Background="Transparent">
                  <ContentPresenter Margin="2,0,2,0" Width="{Binding ChipWidth, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:ColorGallery}}, FallbackValue=13}" Height="{Binding ChipHeight, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:ColorGallery}}, FallbackValue=13}" />
                  <Border BorderThickness="1" BorderBrush="{StaticResource ButtonHoverOuterBorderBrush}" x:Name="hoverBorder" Visibility="Collapsed" Margin="2,0,2,0">
                    <Border BorderThickness="1" BorderBrush="{StaticResource ButtonHoverInnerBorderBrush}" />
                  </Border>
                  <Border BorderThickness="1" BorderBrush="{StaticResource ButtonPressedOuterBorderBrush}" x:Name="selectedBorder" Visibility="Collapsed" Margin="2,0,2,0">
                    <Border BorderThickness="1" BorderBrush="{StaticResource ButtonPressedInnerBorderBrush}" />
                  </Border>
                </Grid>
                <ControlTemplate.Triggers>
                  <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Visibility" Value="Visible" TargetName="hoverBorder" />
                  </Trigger>
                  <Trigger Property="IsSelected" Value="True">
                    <Setter Property="Visibility" Value="Visible" TargetName="selectedBorder" />
                  </Trigger>
                </ControlTemplate.Triggers>
              </ControlTemplate>
            </Setter.Value>
          </Setter>
          <Style.Triggers>
            <Trigger Property="Content">
              <Trigger.Value>
                <Color />
              </Trigger.Value>
              <Setter Property="Opacity" Value="0" />
              <Setter Property="IsHitTestVisible" Value="False" />
            </Trigger>
          </Style.Triggers>
        </Style>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="{x:Type Fluent:ColorGallery}">
    <Setter Property="ChipWidth" Value="13" />
    <Setter Property="ChipHeight" Value="13" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Fluent:ColorGallery}">
          <StackPanel KeyboardNavigation.DirectionalNavigation="Contained">
            <Fluent:MenuItem x:Name="PART_AutomaticColor" Header="Automatic">
              <Fluent:MenuItem.Icon>
                <Rectangle Width="16" Height="16" Stroke="{StaticResource RibbonTopBorderBrush}" Fill="Black" Margin="-2,0,0,0" />
              </Fluent:MenuItem.Icon>
            </Fluent:MenuItem>
            <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
              <StackPanel Background="{TemplateBinding Background}" ClipToBounds="True" Margin="0,1,0,1" KeyboardNavigation.DirectionalNavigation="Contained">
                <Fluent:GroupSeparatorMenuItem Header="Theme Colors" x:Name="themeColorsSeparator" />
                <ListBox KeyboardNavigation.DirectionalNavigation="Contained" x:Name="PART_ThemeColorsListBox" ItemsSource="{Binding ThemeColors, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ColorGalleryListBox}" />
                <ListBox KeyboardNavigation.DirectionalNavigation="Contained" x:Name="PART_ThemeGradientColorsListBox" ItemsSource="{Binding ThemeGradients, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ColorGalleryGradientListBox}" />
                <Fluent:GroupSeparatorMenuItem Header="Standard Colors" x:Name="standardColorsSeparator" />
                <ListBox KeyboardNavigation.DirectionalNavigation="Contained" x:Name="PART_StandardColorsListBox" ItemsSource="{x:Static Fluent:ColorGallery.StandardThemeColors}" Style="{StaticResource ColorGalleryListBox}" />
                <ListBox KeyboardNavigation.DirectionalNavigation="Contained" x:Name="PART_StandardGradientColorsListBox" ItemsSource="{Binding StandardGradients, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ColorGalleryGradientListBox}" />
                <Fluent:GroupSeparatorMenuItem Header="Recent Colors" x:Name="recentColorsSeparator" />
                <ListBox KeyboardNavigation.DirectionalNavigation="Contained" x:Name="PART_RecentColorsListBox" ItemsSource="{x:Static Fluent:ColorGallery.RecentColors}" Style="{StaticResource ColorGalleryListBox}" />
              </StackPanel>
            </ScrollViewer>
            <Fluent:MenuItem x:Name="PART_NoColor" Header="No Color">
              <Fluent:MenuItem.Icon>
                <Rectangle Width="16" Height="16" Stroke="{StaticResource RibbonTopBorderBrush}" Fill="Transparent" Margin="-2,0,0,0" />
              </Fluent:MenuItem.Icon>
            </Fluent:MenuItem>
            <Separator x:Name="separator">
              <Separator.Template>
                <ControlTemplate>
                  <Rectangle Width="Auto" Height="1" Fill="#FFE2E4E7" />
                </ControlTemplate>
              </Separator.Template>
            </Separator>
            <Fluent:MenuItem x:Name="PART_MoreColors" Header="More Colors..." Icon="pack://application:,,,/Fluent;component/Themes/Office2010/Images/MoreColors.png" />
          </StackPanel>
          <ControlTemplate.Triggers>
            <Trigger Property="IsAutomaticColorButtonVisible" Value="False">
              <Setter Property="Visibility" Value="Collapsed" TargetName="PART_AutomaticColor" />
            </Trigger>
            <Trigger Property="IsNoColorButtonVisible" Value="False">
              <Setter Property="Visibility" Value="Collapsed" TargetName="PART_NoColor" />
            </Trigger>
            <Trigger Property="IsMoreColorsButtonVisible" Value="False">
              <Setter Property="Visibility" Value="Collapsed" TargetName="PART_MoreColors" />
              <Setter Property="Visibility" Value="Collapsed" TargetName="separator" />
            </Trigger>
            <Trigger Property="Mode" Value="HighlightColors">
              <Setter Property="ChipWidth" Value="26" />
              <Setter Property="ChipHeight" Value="26" />
              <Setter Property="Visibility" Value="Collapsed" TargetName="themeColorsSeparator" />
              <Setter Property="Visibility" Value="Collapsed" TargetName="standardColorsSeparator" />
              <Setter Property="Visibility" Value="Collapsed" TargetName="recentColorsSeparator" />
              <Setter Property="Visibility" Value="Collapsed" TargetName="PART_ThemeColorsListBox" />
              <Setter Property="Visibility" Value="Collapsed" TargetName="PART_RecentColorsListBox" />
              <Setter Property="Visibility" Value="Collapsed" TargetName="PART_StandardGradientColorsListBox" />
              <Setter Property="Visibility" Value="Collapsed" TargetName="PART_ThemeGradientColorsListBox" />
              <Setter Property="Columns" Value="5" />
              <Setter Property="Style" Value="{StaticResource HightlightColorGalleryListBox}" TargetName="PART_StandardColorsListBox" />
              <Setter Property="ItemsSource" Value="{x:Static Fluent:ColorGallery.HighlightColors}" TargetName="PART_StandardColorsListBox" />
            </Trigger>
            <Trigger Property="Mode" Value="StandardColors">
              <Setter Property="ChipWidth" Value="20" />
              <Setter Property="ChipHeight" Value="20" />
              <Setter Property="Visibility" Value="Collapsed" TargetName="themeColorsSeparator" />
              <Setter Property="Visibility" Value="Collapsed" TargetName="standardColorsSeparator" />
              <Setter Property="Visibility" Value="Collapsed" TargetName="recentColorsSeparator" />
              <Setter Property="Visibility" Value="Collapsed" TargetName="PART_ThemeColorsListBox" />
              <Setter Property="Visibility" Value="Collapsed" TargetName="PART_RecentColorsListBox" />
              <Setter Property="Visibility" Value="Collapsed" TargetName="PART_StandardColorsListBox" />
              <Setter Property="Visibility" Value="Collapsed" TargetName="PART_ThemeGradientColorsListBox" />
              <Setter Property="Columns" Value="5" />
              <Setter Property="StandardColorGridRows" Value="6" />
              <Setter Property="ItemsSource" Value="{x:Static Fluent:ColorGallery.StandardColors}" TargetName="PART_StandardGradientColorsListBox" />
            </Trigger>
            <DataTrigger Binding="{Binding ThemeColors.Count, RelativeSource={RelativeSource Self}}" Value="0">
              <Setter Property="Visibility" Value="Collapsed" TargetName="themeColorsSeparator" />
            </DataTrigger>
            <DataTrigger Binding="{Binding Count, Source={x:Static Fluent:ColorGallery.RecentColors}}" Value="0">
              <Setter Property="Visibility" Value="Collapsed" TargetName="recentColorsSeparator" />
            </DataTrigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="{x:Type Fluent:StatusBar}" TargetType="{x:Type Fluent:StatusBar}">
    <Setter Property="SnapsToDevicePixels" Value="True" />
    <Setter Property="Height" Value="22" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Fluent:StatusBar}">
          <Border BorderThickness="0,1" BorderBrush="{StaticResource StatusBarBorderBrushBrush}">
            <Border Height="Auto" BorderThickness="0,1" BorderBrush="{StaticResource StatusBarInnerBorderBrush}" Background="{StaticResource StatusBarInnerBackgroundBrush}">
              <Fluent:StatusBarPanel IsItemsHost="True" x:Name="itemsPresenter" Height="Auto" Margin="0" />
            </Border>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsWindowMaximized" Value="False">
              <Setter Property="Margin" TargetName="itemsPresenter" Value="0,0,16,0" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <ControlTemplate x:Key="RibbonStatusBarContextMenuItemControlTemplate" TargetType="{x:Type Fluent:StatusBarMenuItem}">
    <Grid Width="Auto" Height="22" Background="#00000000">
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="25" />
        <ColumnDefinition Width="*" />
        <ColumnDefinition Width="Auto" />
      </Grid.ColumnDefinitions>
      <Border x:Name="border" HorizontalAlignment="Stretch" Margin="0" Width="Auto" Visibility="Collapsed" Background="{StaticResource ButtonHoverOuterBackgroundBrush}" BorderBrush="{StaticResource ButtonHoverOuterBorderBrush}" BorderThickness="1" CornerRadius="2" Grid.Column="0" Grid.ColumnSpan="3">
        <Border Background="{StaticResource ButtonHoverInnerBackgroundBrush}" BorderBrush="{StaticResource ButtonHoverInnerBorderBrush}" BorderThickness="1" CornerRadius="1" />
      </Border>
      <TextBlock x:Name="textBlock_Copy" Text="{Binding StatusBarItem.Title, RelativeSource={RelativeSource TemplatedParent}}" Width="Auto" Height="Auto" Margin="9,3,30,3" VerticalAlignment="Center" Grid.Column="1" TextTrimming="None" Visibility="Hidden" HorizontalAlignment="Left" />
      <TextBlock x:Name="textBlock" Text="{Binding StatusBarItem.Title, RelativeSource={RelativeSource TemplatedParent}}" Width="Auto" Height="Auto" Margin="9,3,3,3" VerticalAlignment="Center" Grid.Column="1" TextTrimming="CharacterEllipsis" />
      <Rectangle x:Name="rectangle" Fill="{StaticResource MenuItemCheckBoxBackgroundBrush}" Stroke="{StaticResource MenuItemCheckBoxBorderBrush}" Grid.ColumnSpan="1" HorizontalAlignment="Center" VerticalAlignment="Center" Width="20" Height="20" RadiusX="1" RadiusY="1" Visibility="Collapsed" />
      <Image x:Name="image" HorizontalAlignment="Center" VerticalAlignment="Center" Source="/Fluent;Component/Themes/Office2010/Images/Checked.png" Stretch="None" Visibility="Collapsed" SnapsToDevicePixels="True" />
      <Image x:Name="iconImage" HorizontalAlignment="Center" Margin="3,2,2,2" VerticalAlignment="Center" Width="Auto" Source="{TemplateBinding Icon}" SnapsToDevicePixels="True" />
      <TextBlock Text="{Binding StatusBarItem.Value, RelativeSource={RelativeSource TemplatedParent}}" Width="Auto" Height="Auto" Margin="9,3,3,3" VerticalAlignment="Center" Grid.Column="3" TextTrimming="CharacterEllipsis" />
      <Path x:Name="path" Stretch="Fill" Stroke="{x:Null}" HorizontalAlignment="Right" Margin="1,0,4,0" Width="4" Data="M0,0L1,1 0,2z" Height="6" Grid.Column="3">
        <Path.Fill>
          <LinearGradientBrush EndPoint="0.945,0.872" StartPoint="0.055,0.128">
            <GradientStop Color="Black" Offset="1" />
            <GradientStop Color="#FF828282" />
          </LinearGradientBrush>
        </Path.Fill>
      </Path>
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="IsChecked" Value="True">
        <Setter Property="Visibility" TargetName="rectangle" Value="Visible" />
      </Trigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="Icon" Value="{x:Null}" />
          <Condition Property="IsChecked" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="Visibility" TargetName="image" Value="Visible" />
      </MultiTrigger>
      <Trigger Property="HasItems" Value="False">
        <Setter Property="Visibility" TargetName="path" Value="Collapsed" />
      </Trigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsHighlighted" Value="True" />
          <Condition Property="IsEnabled" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="Visibility" TargetName="border" Value="Visible" />
      </MultiTrigger>
      <!--<Trigger Property="IsEnabled" Value="False">
        <Setter Property="Opacity" TargetName="iconImage" Value="0.5"/>
        <Setter Property="Opacity" TargetName="image" Value="0.5"/>
        <Setter Property="Opacity" TargetName="textBlock" Value="0.5"/>
        <Setter Property="Effect" TargetName="iconImage">
          <Setter.Value>
            <Fluent:GrayscaleEffect/>
          </Setter.Value>
        </Setter>
        <Setter Property="Effect" TargetName="image">
          <Setter.Value>
            <Fluent:GrayscaleEffect/>
          </Setter.Value>
        </Setter>
      </Trigger>-->
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <Style BasedOn="{StaticResource RibbonStatusBarItemStyle}" TargetType="{x:Type Fluent:StatusBarItem}" />
  <Style x:Key="SliderThumbStyle" TargetType="{x:Type Thumb}">
    <Setter Property="SnapsToDevicePixels" Value="true" />
    <Setter Property="OverridesDefaultStyle" Value="true" />
    <Setter Property="Height" Value="14" />
    <Setter Property="Width" Value="14" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Thumb}">
          <Grid Margin="2.5,0.5">
            <Path x:Name="path1" Data="M0,0L9,0 9,9 4.5,13 0,9z" Fill="{StaticResource RoundButtonBackgroundBrush}" Margin="0" StrokeStartLineCap="Flat" Stretch="Fill" StrokeEndLineCap="Flat" Stroke="{StaticResource RoundButtonBorderBrush}" StrokeThickness="1" StrokeMiterLimit="10" StrokeLineJoin="Miter" VerticalAlignment="Center" Width="9" Height="13" HorizontalAlignment="Center" />
            <Path x:Name="path" Data="M0,0L9,0 9,9 4.5,13 0,9z" Fill="{StaticResource RoundButtonBackgroundBrush}" Margin="0" StrokeStartLineCap="Flat" Stretch="Fill" StrokeEndLineCap="Flat" Stroke="{StaticResource RoundButtonBorderBrush}" StrokeThickness="1" StrokeMiterLimit="10" StrokeLineJoin="Miter" VerticalAlignment="Center" Width="7" Height="11" HorizontalAlignment="Center" Visibility="Collapsed" />
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsDragging" Value="True">
              <Setter Property="Visibility" TargetName="path" Value="Visible" />
              <Setter Property="Fill" TargetName="path1" Value="{StaticResource ButtonPressedOuterBackgroundBrush}" />
              <Setter Property="Stroke" TargetName="path1" Value="{StaticResource ButtonPressedOuterBorderBrush}" />
              <Setter Property="Fill" TargetName="path" Value="{StaticResource ButtonPressedInnerBackgroundBrush}" />
              <Setter Property="Stroke" TargetName="path" Value="{StaticResource ButtonPressedInnerBorderBrush}" />
            </Trigger>
            <Trigger Property="Background" Value="Red">
              <Setter Property="Visibility" TargetName="path" Value="Visible" />
              <Setter Property="Fill" TargetName="path1" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
              <Setter Property="Stroke" TargetName="path1" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
              <Setter Property="Fill" TargetName="path" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
              <Setter Property="Stroke" TargetName="path" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <ControlTemplate x:Key="SliderRepeatButtonControlTemplate" TargetType="{x:Type RepeatButton}">
    <Grid>
      <Ellipse x:Name="path1" Margin="0" Width="16" Height="16" VerticalAlignment="Center" HorizontalAlignment="Center" Stroke="{StaticResource RoundButtonBorderBrush}" Fill="{StaticResource RoundButtonBackgroundBrush}" />
      <Ellipse x:Name="path" Fill="{x:Null}" Margin="0" Stroke="{StaticResource ButtonBorderBrush}" Width="14" Height="14" VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="Hidden" />
      <ContentPresenter Margin="0" Width="14" Height="14" HorizontalAlignment="Center" VerticalAlignment="Center" />
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="IsPressed" Value="True">
        <Setter Property="Visibility" TargetName="path" Value="Visible" />
        <Setter Property="Fill" TargetName="path1" Value="{StaticResource ButtonPressedOuterBackgroundBrush}" />
        <Setter Property="Stroke" TargetName="path1" Value="{StaticResource ButtonPressedOuterBorderBrush}" />
        <Setter Property="Fill" TargetName="path" Value="{StaticResource ButtonPressedInnerBackgroundBrush}" />
        <Setter Property="Stroke" TargetName="path" Value="{StaticResource ButtonPressedInnerBorderBrush}" />
      </Trigger>
      <Trigger Property="IsMouseOver" Value="True">
        <Setter Property="Visibility" TargetName="path" Value="Visible" />
        <Setter Property="Fill" TargetName="path1" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
        <Setter Property="Stroke" TargetName="path1" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
        <Setter Property="Fill" TargetName="path" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
        <Setter Property="Stroke" TargetName="path" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <Style TargetType="{x:Type ResizeGrip}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ResizeGrip}">
          <Grid Width="11" Height="11" Background="Transparent">
            <Grid Width="3" Height="3" HorizontalAlignment="Right" VerticalAlignment="Bottom">
              <Rectangle Width="2" Height="2" Fill="{StaticResource ResizeGripBack}" HorizontalAlignment="Right" VerticalAlignment="Bottom" />
              <Rectangle Width="2" Height="2" Fill="{StaticResource ResizeGripFront}" HorizontalAlignment="Left" VerticalAlignment="Top" />
            </Grid>
            <Grid Width="3" Height="3" HorizontalAlignment="Center" VerticalAlignment="Bottom">
              <Rectangle Width="2" Height="2" Fill="{StaticResource ResizeGripBack}" HorizontalAlignment="Right" VerticalAlignment="Bottom" />
              <Rectangle Width="2" Height="2" Fill="{StaticResource ResizeGripFront}" HorizontalAlignment="Left" VerticalAlignment="Top" />
            </Grid>
            <Grid Width="3" Height="3" HorizontalAlignment="Left" VerticalAlignment="Bottom">
              <Rectangle Width="2" Height="2" Fill="{StaticResource ResizeGripBack}" HorizontalAlignment="Right" VerticalAlignment="Bottom" />
              <Rectangle Width="2" Height="2" Fill="{StaticResource ResizeGripFront}" HorizontalAlignment="Left" VerticalAlignment="Top" />
            </Grid>
            <Grid Width="3" Height="3" HorizontalAlignment="Right" VerticalAlignment="Center">
              <Rectangle Width="2" Height="2" Fill="{StaticResource ResizeGripBack}" HorizontalAlignment="Right" VerticalAlignment="Bottom" />
              <Rectangle Width="2" Height="2" Fill="{StaticResource ResizeGripFront}" HorizontalAlignment="Left" VerticalAlignment="Top" />
            </Grid>
            <Grid Width="3" Height="3" HorizontalAlignment="Center" VerticalAlignment="Center">
              <Rectangle Width="2" Height="2" Fill="{StaticResource ResizeGripBack}" HorizontalAlignment="Right" VerticalAlignment="Bottom" />
              <Rectangle Width="2" Height="2" Fill="{StaticResource ResizeGripFront}" HorizontalAlignment="Left" VerticalAlignment="Top" />
            </Grid>
            <Grid Width="3" Height="3" HorizontalAlignment="Right" VerticalAlignment="Top">
              <Rectangle Width="2" Height="2" Fill="{StaticResource ResizeGripBack}" HorizontalAlignment="Right" VerticalAlignment="Bottom" />
              <Rectangle Width="2" Height="2" Fill="{StaticResource ResizeGripFront}" HorizontalAlignment="Left" VerticalAlignment="Top" />
            </Grid>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <ControlTemplate x:Key="DwmRibbonWindowControlTemplate" TargetType="{x:Type Fluent:RibbonWindow}">
    <Grid>
      <AdornerDecorator x:Name="adornerDecorator" Margin="0">
        <Grid x:Name="PART_MainGrid" Margin="0" Background="{StaticResource TransparentBrush}" VerticalAlignment="Stretch">
          <Grid x:Name="PART_TitleBar" Margin="8" VerticalAlignment="Top" Height="{TemplateBinding CaptionHeight}" Background="{StaticResource TransparentBrush}" IsHitTestVisible="True" />
          <Rectangle x:Name="rectangle" Stroke="{x:Null}" HorizontalAlignment="Left" Width="35" StrokeThickness="0" Margin="15,27,0,1" VerticalAlignment="Top" Height="23" IsHitTestVisible="False" Fill="{StaticResource RibbonTabControlTopGradientLeftBrush}" SnapsToDevicePixels="True" />
          <Rectangle x:Name="rectangle1" Stroke="{x:Null}" HorizontalAlignment="Right" Width="35" StrokeThickness="0" Margin="0,27,15.1,1" Height="23" VerticalAlignment="Top" IsHitTestVisible="False" Fill="{StaticResource RibbonTabControlTopGradientRightBrush}" SnapsToDevicePixels="True" />
          <Rectangle x:Name="rectangle2" Stroke="{x:Null}" HorizontalAlignment="Stretch" Width="Auto" StrokeThickness="0" Height="23" Margin="50,27,50,1" VerticalAlignment="Top" IsHitTestVisible="False" Fill="{StaticResource RibbonTabControlTopGradientCenterBrush}" SnapsToDevicePixels="True" />
          <Grid x:Name="grid" Background="{TemplateBinding Background}" Margin="{TemplateBinding GlassBorderThickness}" />
          <StackPanel Background="Transparent" x:Name="PART_IconImage" Margin="8,7,8,8" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Top">
            <Image x:Name="iconImage" Height="16" HorizontalAlignment="Left" VerticalAlignment="Top" Source="{Binding Icon, Converter={StaticResource IconConvert}, RelativeSource={RelativeSource TemplatedParent}}" Width="16" SnapsToDevicePixels="True" />
          </StackPanel>
          <ContentPresenter Margin="8,1,8,8" x:Name="contentPresenter" />
          <ResizeGrip x:Name="PART_ResizeGrip" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Bottom" Focusable="False" Margin="0,0,5.5,5.5" Background="Transparent" Visibility="Collapsed" />
        </Grid>
      </AdornerDecorator>
    </Grid>
    <ControlTemplate.Triggers>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="ResizeMode" Value="CanResizeWithGrip" />
          <Condition Property="WindowState" Value="Normal" />
        </MultiTrigger.Conditions>
        <Setter Property="Visibility" TargetName="PART_ResizeGrip" Value="Visible" />
      </MultiTrigger>
      <Trigger Property="WindowState" Value="Maximized">
        <Setter Property="Margin" TargetName="iconImage" Value="0,4,0,0" />
        <Setter Property="Margin" TargetName="adornerDecorator" Value="0" />
        <Setter Property="Margin" TargetName="contentPresenter" Value="8,6,8,8" />
        <Setter Property="Margin" TargetName="rectangle" Value="15,31,0,1" />
        <Setter Property="Margin" TargetName="rectangle1" Value="0,31,15.1,1" />
        <Setter Property="Margin" TargetName="rectangle2" Value="50,31,50,1" />
      </Trigger>
      <Trigger Property="IsIconVisible" Value="False">
        <Setter Property="Visibility" TargetName="PART_IconImage" Value="Collapsed" />
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <ControlTemplate x:Key="CaptionButtonControlTemplate" TargetType="{x:Type Button}">
    <Grid Background="Transparent">
      <Border x:Name="hoverBorder" Margin="0" BorderBrush="{StaticResource CaptionButtonHoverOutterBorderBrush}" BorderThickness="1" CornerRadius="2" Visibility="Collapsed">
        <Border x:Name="hoverBorderInner" BorderBrush="{StaticResource CaptionButtonHoverInnerBorderBrush}" BorderThickness="1" CornerRadius="1" Background="{StaticResource CaptionButtonHoverInnerBackgroundBrush}" />
      </Border>
      <Border x:Name="pressedBorder" Margin="0" BorderBrush="{StaticResource CaptionButtonPressedOutterBorderBrush}" BorderThickness="1" CornerRadius="2" Visibility="Collapsed">
        <Border x:Name="pressedBorderInner" BorderBrush="{StaticResource CaptionButtonPressedInnerBorderBrush}" BorderThickness="1" CornerRadius="1" Background="{StaticResource CaptionButtonPressedInnerBackgroundBrush}" />
      </Border>
      <ContentPresenter Margin="0" HorizontalAlignment="Center" VerticalAlignment="Center" />
    </Grid>
    <ControlTemplate.Triggers>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsMouseOver" Value="True" />
          <Condition Property="IsPressed" Value="False" />
        </MultiTrigger.Conditions>
        <Setter Property="Visibility" TargetName="hoverBorder" Value="Visible" />
      </MultiTrigger>
      <Trigger Property="IsPressed" Value="True">
        <Setter Property="Visibility" TargetName="pressedBorder" Value="Visible" />
      </Trigger>
      <Trigger Property="Background" Value="Red">
        <Setter Property="BorderBrush" TargetName="hoverBorder" Value="{StaticResource CaptionButtonCloseHoverOutterBorderBrush}" />
        <Setter Property="BorderBrush" TargetName="hoverBorderInner" Value="{StaticResource CaptionButtonCloseHoverInnerBorderBrush}" />
        <Setter Property="Background" TargetName="hoverBorderInner" Value="{StaticResource CaptionButtonCloseHoverInnerBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="pressedBorder" Value="{StaticResource CaptionButtonClosePressedOutterBorderBrush}" />
        <Setter Property="BorderBrush" TargetName="pressedBorderInner" Value="{StaticResource CaptionButtonClosePressedInnerBorderBrush}" />
        <Setter Property="Background" TargetName="pressedBorderInner" Value="{StaticResource CaptionButtonClosePressedInnerBackgroundBrush}" />
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <Style x:Key="{x:Type Fluent:Spinner}" TargetType="Fluent:Spinner" BasedOn="{StaticResource SpinnerStyle}" />
  <Style x:Key="{x:Type Fluent:TwoLineLabel}" TargetType="Fluent:TwoLineLabel" BasedOn="{StaticResource TwoLineLabelStyle}" />
  <Style x:Key="{x:Type Fluent:KeyTip}" TargetType="Fluent:KeyTip" BasedOn="{StaticResource KeyTipStyle}" />
  <Style x:Key="{x:Type Fluent:ScreenTip}" TargetType="{x:Type Fluent:ScreenTip}" BasedOn="{StaticResource ScreenTipStyle}" />
  <Style x:Key="{x:Type ToolTip}" TargetType="{x:Type ToolTip}" BasedOn="{StaticResource ToolTipStyle}" />
  <Style x:Key="{x:Type Fluent:GalleryGroupContainer}" TargetType="{x:Type Fluent:GalleryGroupContainer}" BasedOn="{StaticResource GalleryGroupContainerStyle}" />
  <Style x:Key="{x:Type Fluent:SeparatorTabItem}" TargetType="{x:Type Fluent:SeparatorTabItem}" BasedOn="{StaticResource SeparatorTabItemStyle}" />
  <Style x:Key="{x:Type Fluent:BackstageTabItem}" TargetType="{x:Type Fluent:BackstageTabItem}" BasedOn="{StaticResource BackstageTabItemStyle}" />
  <Style x:Key="{x:Type Fluent:GalleryItem}" TargetType="{x:Type Fluent:GalleryItem}" BasedOn="{StaticResource GalleryItemStyle}" />
  <Style x:Key="{x:Type Fluent:RibbonTabItem}" TargetType="{x:Type Fluent:RibbonTabItem}" BasedOn="{StaticResource RibbonTabItemStyle}" />
  <Style x:Key="{x:Type Fluent:RibbonToolBar}" TargetType="{x:Type Fluent:RibbonToolBar}" BasedOn="{StaticResource RibbonToolBarStyle}" />
  <ControlTemplate x:Key="ApplicationMenuSecondLevelItemTemplate" TargetType="{x:Type Fluent:MenuItem}">
    <ControlTemplate.Resources>
      <ResourceDictionary>
        <Style x:Key="{x:Type ScrollViewer}" TargetType="{x:Type ScrollViewer}" BasedOn="{StaticResource MenuScrollViewer}" />
      </ResourceDictionary>
    </ControlTemplate.Resources>
    <Grid Width="Auto" Height="53" Background="#00000000">
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="44" />
        <ColumnDefinition Width="*" />
        <ColumnDefinition Width="Auto" />
      </Grid.ColumnDefinitions>
      <Border x:Name="border" HorizontalAlignment="Stretch" Margin="0" Width="Auto" Visibility="Collapsed" Background="{StaticResource ButtonHoverOuterBackgroundBrush}" BorderBrush="{StaticResource ButtonHoverOuterBorderBrush}" BorderThickness="1" CornerRadius="2" Grid.Column="0" Grid.ColumnSpan="3">
        <Border Background="{StaticResource ButtonHoverInnerBackgroundBrush}" BorderBrush="{StaticResource ButtonHoverInnerBorderBrush}" BorderThickness="1" CornerRadius="1" />
      </Border>
      <TextBlock x:Name="textBlock_Copy" FontWeight="Bold" Text="{TemplateBinding Header}" Width="Auto" Height="Auto" Margin="9,5,13,3" VerticalAlignment="Center" Grid.Column="1" TextTrimming="None" Visibility="Hidden" HorizontalAlignment="Left" />
      <TextBlock x:Name="textBlock" FontWeight="Bold" Text="{TemplateBinding Header}" Width="Auto" Height="Auto" Margin="9,5,3,3" VerticalAlignment="Top" Grid.Column="1" d:LayoutOverrides="Width" TextTrimming="CharacterEllipsis" />
      <TextBlock x:Name="textBlockDesc" Text="{TemplateBinding Description}" Width="Auto" HorizontalAlignment="Stretch" Height="Auto" Margin="9,22,3,3" VerticalAlignment="Top" Grid.Column="1" d:LayoutOverrides="Width" TextWrapping="Wrap" />
      <Rectangle x:Name="rectangle" Fill="{StaticResource MenuItemCheckBoxBackgroundBrush}" Stroke="{StaticResource MenuItemCheckBoxBorderBrush}" Grid.ColumnSpan="1" HorizontalAlignment="Center" VerticalAlignment="Center" Width="40" Height="40" RadiusX="1" RadiusY="1" Visibility="Collapsed" />
      <Image x:Name="image" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,4,0,0" Source="/Fluent;Component/Themes/Office2010/Images/Checked.png" Stretch="None" Visibility="Collapsed" SnapsToDevicePixels="True" />
      <ContentPresenter x:Name="iconImage" HorizontalAlignment="Center" Height="32" VerticalAlignment="Top" Margin="3,4,2,2" Content="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource StringToImageConvert}}" Width="32" SnapsToDevicePixels="True" />
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="IsChecked" Value="True">
        <Setter Property="Visibility" TargetName="rectangle" Value="Visible" />
      </Trigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="Icon" Value="{x:Null}" />
          <Condition Property="IsChecked" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="Visibility" TargetName="image" Value="Visible" />
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsHighlighted" Value="True" />
          <Condition Property="IsEnabled" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="Visibility" TargetName="border" Value="Visible" />
      </MultiTrigger>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="Opacity" TargetName="iconImage" Value="0.5" />
        <Setter Property="Opacity" TargetName="image" Value="0.5" />
        <Setter Property="Opacity" TargetName="textBlock" Value="0.5" />
        <Setter Property="Effect" TargetName="iconImage">
          <Setter.Value>
            <Fluent:GrayscaleEffect />
          </Setter.Value>
        </Setter>
        <Setter Property="Effect" TargetName="image">
          <Setter.Value>
            <Fluent:GrayscaleEffect />
          </Setter.Value>
        </Setter>
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <ControlTemplate x:Key="HeaderApplicationMenuSecondLevelItemTemplate" TargetType="{x:Type Fluent:MenuItem}">
    <ControlTemplate.Resources>
      <ResourceDictionary>
        <Style x:Key="{x:Type ScrollViewer}" TargetType="{x:Type ScrollViewer}" BasedOn="{StaticResource MenuScrollViewer}" />
        <Style x:Key="{x:Type Fluent:MenuItem}" TargetType="{x:Type Fluent:MenuItem}" BasedOn="{StaticResource MenuItemStyle}" />
      </ResourceDictionary>
    </ControlTemplate.Resources>
    <Grid Width="Auto" Height="53" Background="#00000000">
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="44" />
        <ColumnDefinition Width="*" />
        <ColumnDefinition Width="Auto" />
      </Grid.ColumnDefinitions>
      <Border x:Name="border" HorizontalAlignment="Stretch" Margin="0" Width="Auto" Visibility="Collapsed" Background="{StaticResource ButtonHoverOuterBackgroundBrush}" BorderBrush="{StaticResource ButtonHoverOuterBorderBrush}" BorderThickness="1" CornerRadius="2" Grid.Column="0" Grid.ColumnSpan="3">
        <Border Background="{StaticResource ButtonHoverInnerBackgroundBrush}" BorderBrush="{StaticResource ButtonHoverInnerBorderBrush}" BorderThickness="1" CornerRadius="1" />
      </Border>
      <TextBlock x:Name="textBlock_Copy" FontWeight="Bold" Text="{TemplateBinding Header}" Width="Auto" Height="Auto" Margin="9,5,13,3" VerticalAlignment="Center" Grid.Column="1" TextTrimming="None" Visibility="Hidden" HorizontalAlignment="Left" />
      <TextBlock x:Name="textBlock" FontWeight="Bold" Text="{TemplateBinding Header}" Width="Auto" Height="Auto" Margin="9,5,3,3" VerticalAlignment="Top" Grid.Column="1" d:LayoutOverrides="Width" TextTrimming="CharacterEllipsis" />
      <TextBlock x:Name="textBlockDesc" Text="{TemplateBinding Description}" Width="Auto" HorizontalAlignment="Stretch" Height="Auto" Margin="9,22,3,3" VerticalAlignment="Top" Grid.Column="1" d:LayoutOverrides="Width" TextWrapping="Wrap" />
      <Rectangle x:Name="rectangle" Fill="{StaticResource MenuItemCheckBoxBackgroundBrush}" Stroke="{StaticResource MenuItemCheckBoxBorderBrush}" Grid.ColumnSpan="1" HorizontalAlignment="Center" VerticalAlignment="Center" Width="40" Height="40" RadiusX="1" RadiusY="1" Visibility="Collapsed" />
      <Image x:Name="image" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,4,0,0" Source="/Fluent;Component/Themes/Office2010/Images/Checked.png" Stretch="None" Visibility="Collapsed" SnapsToDevicePixels="True" />
      <ContentPresenter x:Name="iconImage" HorizontalAlignment="Center" Height="32" VerticalAlignment="Top" Margin="3,4,2,2" Content="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource StringToImageConvert}}" Width="32" SnapsToDevicePixels="True" />
      <Path x:Name="path" Stretch="Fill" Stroke="{x:Null}" HorizontalAlignment="Right" Margin="1,0,9,0" Width="4" Data="M0,0L1,1 0,2z" Height="7" Grid.Column="3">
        <Path.Fill>
          <LinearGradientBrush EndPoint="0.945,0.872" StartPoint="0.055,0.128">
            <GradientStop Color="#FF7C7C7C" Offset="1" />
            <GradientStop Color="#FF9E9E9E" />
          </LinearGradientBrush>
        </Path.Fill>
      </Path>
      <Popup x:Name="PART_Popup" Placement="Right" IsOpen="{TemplateBinding IsSubmenuOpen}" AllowsTransparency="True" Focusable="False" PopupAnimation="Fade" Margin="0,0,0,0" VerticalAlignment="Top" Grid.ColumnSpan="2">
        <Grid Name="DropDown" SnapsToDevicePixels="True" Margin="0" VerticalAlignment="Stretch">
          <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="4" />
          </Grid.RowDefinitions>
          <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="4" />
          </Grid.ColumnDefinitions>
          <Rectangle HorizontalAlignment="Left" VerticalAlignment="Top" Width="4" Height="4" Grid.Row="1" Grid.Column="1" StrokeThickness="0" Margin="-1,-1,0,0">
            <Rectangle.Fill>
              <RadialGradientBrush RadiusX="0.984" Center="0.017,0.002" GradientOrigin="0.017,0.002" RadiusY="1">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="-1,3,0,0" VerticalAlignment="Top" Width="4" Height="4" Grid.Column="1" Grid.Row="0">
            <Rectangle.Fill>
              <RadialGradientBrush Center="0.032,1.01" GradientOrigin="0.032,1.01" RadiusX="0.984" RadiusY="1">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="3,-1,0,0" VerticalAlignment="Top" Width="4" Height="4" Grid.Column="0" Grid.Row="1">
            <Rectangle.Fill>
              <RadialGradientBrush Center="0.996,0.027" GradientOrigin="0.996,0.027" RadiusX="0.984" RadiusY="1">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Stretch" Margin="7,-1,1,0" VerticalAlignment="Top" Width="Auto" Height="4" Grid.Column="0" Grid.Row="1">
            <Rectangle.Fill>
              <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" MappingMode="RelativeToBoundingBox">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </LinearGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="-1,7,0,1" VerticalAlignment="Stretch" Width="4" Height="Auto" Grid.Column="1" Grid.Row="0">
            <Rectangle.Fill>
              <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5" MappingMode="RelativeToBoundingBox">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </LinearGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Border x:Name="DropDownBorder" SnapsToDevicePixels="True" Background="{StaticResource ContextMenuBarBackgroundBrush}" BorderBrush="{StaticResource ContextMenuBarBorderBrush}" BorderThickness="1" CornerRadius="2,2,1,1" Grid.ColumnSpan="1" d:LayoutOverrides="Width, Height" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
            <Grid Width="Auto" Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
              <Border VerticalAlignment="Stretch" Width="Auto" Height="Auto" BorderBrush="{StaticResource ContextMenuBarBackgroundBrush}" BorderThickness="1" CornerRadius="1" />
              <Grid Margin="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                <Grid.RowDefinitions>
                  <RowDefinition Height="*" />
                  <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Path Fill="{x:Null}" Stretch="Fill" Stroke="#FFE2E4E7" HorizontalAlignment="Left" Margin="24,0,0,0" Width="1" Height="Auto" Data="M0,0L0,1" Grid.RowSpan="2" Visibility="Visible" />
                <ScrollViewer VerticalScrollBarVisibility="Auto" x:Name="PART_ScrollViewer" Margin="1" SnapsToDevicePixels="True">
                  <Fluent:MenuPanel x:Name="PART_MenuPanel" IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" />
                </ScrollViewer>
              </Grid>
            </Grid>
          </Border>
        </Grid>
      </Popup>
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="IsChecked" Value="True">
        <Setter Property="Visibility" TargetName="rectangle" Value="Visible" />
      </Trigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="Icon" Value="{x:Null}" />
          <Condition Property="IsChecked" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="Visibility" TargetName="image" Value="Visible" />
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsHighlighted" Value="True" />
          <Condition Property="IsEnabled" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="Visibility" TargetName="border" Value="Visible" />
      </MultiTrigger>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="Opacity" TargetName="iconImage" Value="0.5" />
        <Setter Property="Opacity" TargetName="image" Value="0.5" />
        <Setter Property="Opacity" TargetName="textBlock" Value="0.5" />
        <Setter Property="Effect" TargetName="iconImage">
          <Setter.Value>
            <Fluent:GrayscaleEffect />
          </Setter.Value>
        </Setter>
        <Setter Property="Effect" TargetName="image">
          <Setter.Value>
            <Fluent:GrayscaleEffect />
          </Setter.Value>
        </Setter>
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <ControlTemplate x:Key="SplitedApplicationMenuSecondLevelItemTemplate" TargetType="{x:Type Fluent:MenuItem}">
    <ControlTemplate.Resources>
      <ResourceDictionary>
        <Style x:Key="{x:Type ScrollViewer}" TargetType="{x:Type ScrollViewer}" BasedOn="{StaticResource MenuScrollViewer}" />
        <Style x:Key="{x:Type Fluent:MenuItem}" TargetType="{x:Type Fluent:MenuItem}" BasedOn="{StaticResource MenuItemStyle}" />
      </ResourceDictionary>
    </ControlTemplate.Resources>
    <Grid Width="Auto" Height="53" Background="#00000000">
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="44" />
        <ColumnDefinition Width="*" />
        <ColumnDefinition Width="Auto" />
      </Grid.ColumnDefinitions>
      <Rectangle Grid.Column="2" HorizontalAlignment="Right" Margin="0,4,23,4" Stroke="{StaticResource WindowContentBorderBrush}" Width="1" />
      <Grid HorizontalAlignment="Stretch" Margin="0" Width="Auto" Grid.Column="0" Grid.ColumnSpan="3">
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="0.905*" />
          <ColumnDefinition x:Name="columnDefinition" Width="23" />
        </Grid.ColumnDefinitions>
        <Border x:Name="PART_ButtonBorder" Visibility="Collapsed" Background="{StaticResource ButtonHoverOuterBackgroundBrush}" BorderBrush="{StaticResource ButtonHoverOuterBorderBrush}" BorderThickness="1" CornerRadius="2" Margin="0,0,-1,0">
          <Border x:Name="border1" Background="{StaticResource ButtonHoverInnerBackgroundBrush}" BorderBrush="{StaticResource ButtonHoverInnerBorderBrush}" BorderThickness="1" CornerRadius="1" Grid.ColumnSpan="2" />
        </Border>
        <Border x:Name="border_Copy" HorizontalAlignment="Stretch" Margin="0" Width="Auto" Visibility="Collapsed" BorderBrush="{StaticResource ButtonHoverOuterBorderBrush}" BorderThickness="1" CornerRadius="2" Grid.Column="1" Background="{StaticResource TransparentBrush}">
          <Border x:Name="border1_Copy" Background="{StaticResource ButtonHoverInnerBackgroundBrush}" BorderBrush="{StaticResource ButtonHoverInnerBorderBrush}" BorderThickness="1" CornerRadius="1" Grid.ColumnSpan="1" d:CopyToken="09a4b798-0b8a-441e-b6c8-d7787f8d7e43" Visibility="Collapsed" />
        </Border>
      </Grid>
      <TextBlock x:Name="textBlock_Copy" FontWeight="Bold" Text="{TemplateBinding Header}" Width="Auto" Height="Auto" Margin="9,5,13,3" VerticalAlignment="Center" Grid.Column="1" TextTrimming="None" Visibility="Hidden" HorizontalAlignment="Left" />
      <TextBlock x:Name="textBlock" FontWeight="Bold" Text="{TemplateBinding Header}" Width="Auto" Height="Auto" Margin="9,5,3,3" VerticalAlignment="Top" Grid.Column="1" d:LayoutOverrides="Width" TextTrimming="CharacterEllipsis" />
      <TextBlock x:Name="textBlockDesc" Text="{TemplateBinding Description}" Width="Auto" HorizontalAlignment="Stretch" Height="Auto" Margin="9,22,3,3" VerticalAlignment="Top" Grid.Column="1" d:LayoutOverrides="Width" TextWrapping="Wrap" />
      <Rectangle x:Name="rectangle" Fill="{StaticResource MenuItemCheckBoxBackgroundBrush}" Stroke="{StaticResource MenuItemCheckBoxBorderBrush}" Grid.ColumnSpan="1" HorizontalAlignment="Center" VerticalAlignment="Center" Width="40" Height="40" RadiusX="1" RadiusY="1" Visibility="Collapsed" />
      <Image x:Name="image" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,4,0,0" Source="/Fluent;Component/Themes/Office2010/Images/Checked.png" Stretch="None" Visibility="Collapsed" SnapsToDevicePixels="True" />
      <ContentPresenter x:Name="iconImage" HorizontalAlignment="Center" Height="32" VerticalAlignment="Top" Margin="3,4,2,2" Content="{Binding Icon, Converter={StaticResource StringToImageConvert}, RelativeSource={RelativeSource TemplatedParent}}" Width="32" SnapsToDevicePixels="True" />
      <Path x:Name="path" Stretch="Fill" Stroke="{x:Null}" HorizontalAlignment="Right" Margin="1,0,9,0" Width="4" Data="M0,0L1,1 0,2z" Height="7" Grid.Column="3">
        <Path.Fill>
          <LinearGradientBrush EndPoint="0.945,0.872" StartPoint="0.055,0.128">
            <GradientStop Color="#FF7C7C7C" Offset="1" />
            <GradientStop Color="#FF9E9E9E" />
          </LinearGradientBrush>
        </Path.Fill>
      </Path>
      <Popup x:Name="PART_Popup" Placement="Right" IsOpen="{TemplateBinding IsSubmenuOpen}" AllowsTransparency="True" Focusable="False" PopupAnimation="Fade" Margin="0,0,-4,0" VerticalAlignment="Top" Grid.ColumnSpan="2">
        <Grid x:Name="DropDown" SnapsToDevicePixels="True" Margin="0" VerticalAlignment="Stretch">
          <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="10" />
          </Grid.RowDefinitions>
          <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="10" />
          </Grid.ColumnDefinitions>
          <Rectangle HorizontalAlignment="Left" VerticalAlignment="Top" Width="4" Height="4" Grid.Row="1" Grid.Column="1" StrokeThickness="0" Margin="-1,-1,0,0">
            <Rectangle.Fill>
              <RadialGradientBrush RadiusX="0.984" Center="0.017,0.002" GradientOrigin="0.017,0.002" RadiusY="1">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="-1,3,0,0" VerticalAlignment="Top" Width="4" Height="4" Grid.Column="1" Grid.Row="0">
            <Rectangle.Fill>
              <RadialGradientBrush Center="0.032,1.01" GradientOrigin="0.032,1.01" RadiusX="0.984" RadiusY="1">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="3,-1,0,0" VerticalAlignment="Top" Width="4" Height="4" Grid.Column="0" Grid.Row="1">
            <Rectangle.Fill>
              <RadialGradientBrush Center="0.996,0.027" GradientOrigin="0.996,0.027" RadiusX="0.984" RadiusY="1">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Stretch" Margin="7,-1,1,0" VerticalAlignment="Top" Width="Auto" Height="4" Grid.Column="0" Grid.Row="1">
            <Rectangle.Fill>
              <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" MappingMode="RelativeToBoundingBox">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </LinearGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="-1,7,0,1" VerticalAlignment="Stretch" Width="4" Height="Auto" Grid.Column="1" Grid.Row="0">
            <Rectangle.Fill>
              <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5" MappingMode="RelativeToBoundingBox">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </LinearGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Border x:Name="DropDownBorder" SnapsToDevicePixels="True" Background="{StaticResource ContextMenuBarBackgroundBrush}" BorderBrush="{StaticResource ContextMenuBarBorderBrush}" BorderThickness="1" CornerRadius="1" Grid.ColumnSpan="1" d:LayoutOverrides="Width, Height" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
            <Grid Width="Auto" Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
              <Border VerticalAlignment="Stretch" Width="Auto" Height="Auto" BorderBrush="{StaticResource ContextMenuBarBackgroundBrush}" BorderThickness="1" CornerRadius="1" />
              <Grid Margin="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                <Grid.RowDefinitions>
                  <RowDefinition Height="*" />
                  <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Path Fill="{x:Null}" Stretch="Fill" Stroke="#FFE2E4E7" HorizontalAlignment="Left" Margin="24,0,0,0" Width="1" Height="Auto" Data="M0,0L0,1" Grid.RowSpan="2" Visibility="Visible" />
                <ScrollViewer Margin="1" x:Name="PART_ScrollViewer" Style="{StaticResource MenuScrollViewer}" SnapsToDevicePixels="True">
                  <Fluent:MenuPanel x:Name="PART_MenuPanel" IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" />
                </ScrollViewer>
              </Grid>
            </Grid>
          </Border>
        </Grid>
      </Popup>
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="IsMouseOver" Value="True" SourceName="border_Copy">
        <Setter Property="Visibility" TargetName="border1_Copy" Value="Visible" />
      </Trigger>
      <Trigger Property="IsChecked" Value="True">
        <Setter Property="Visibility" TargetName="rectangle" Value="Visible" />
      </Trigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="Icon" Value="{x:Null}" />
          <Condition Property="IsChecked" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="Visibility" TargetName="image" Value="Visible" />
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsHighlighted" Value="True" />
          <Condition Property="IsEnabled" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="Visibility" TargetName="PART_ButtonBorder" Value="Visible" />
        <Setter Property="Visibility" TargetName="border_Copy" Value="Visible" />
      </MultiTrigger>
      <Trigger Property="IsSubmenuOpen" Value="True">
        <Setter Property="Visibility" TargetName="border1_Copy" Value="Visible" />
      </Trigger>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="Opacity" TargetName="iconImage" Value="0.5" />
        <Setter Property="Opacity" TargetName="image" Value="0.5" />
        <Setter Property="Opacity" TargetName="textBlock" Value="0.5" />
        <Setter Property="Effect" TargetName="iconImage">
          <Setter.Value>
            <Fluent:GrayscaleEffect />
          </Setter.Value>
        </Setter>
        <Setter Property="Effect" TargetName="image">
          <Setter.Value>
            <Fluent:GrayscaleEffect />
          </Setter.Value>
        </Setter>
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <Style x:Key="ApplicationMenuSecondLevelStyle" TargetType="{x:Type Fluent:MenuItem}">
    <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
    <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden" />
    <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}" />
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
    <Setter Property="Foreground" Value="{StaticResource DefaultFontBrush}" />
    <Setter Property="ResizeMode" Value="None" />
    <Setter Property="SnapsToDevicePixels" Value="True" />
    <Setter Property="Fluent:FrameworkHelper.UseLayoutRounding" Value="True" />
    <Setter Property="OverridesDefaultStyle" Value="True" />
    <Setter Property="Template" Value="{StaticResource ApplicationMenuSecondLevelItemTemplate}" />
    <Style.Triggers>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="Fluent:MenuItem.IsSplited" Value="True" />
          <Condition Property="HasItems" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="Template" Value="{StaticResource SplitedApplicationMenuSecondLevelItemTemplate}" />
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="Fluent:MenuItem.IsSplited" Value="False" />
          <Condition Property="HasItems" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="Template" Value="{StaticResource HeaderApplicationMenuSecondLevelItemTemplate}" />
      </MultiTrigger>
    </Style.Triggers>
  </Style>
  <ControlTemplate x:Key="ApplicationMenuItemTemplate" TargetType="{x:Type Fluent:MenuItem}">
    <ControlTemplate.Resources>
      <ResourceDictionary>
        <Style x:Key="{x:Type ScrollViewer}" TargetType="{x:Type ScrollViewer}" BasedOn="{StaticResource MenuScrollViewer}" />
      </ResourceDictionary>
    </ControlTemplate.Resources>
    <Grid Width="Auto" Height="44" Background="#00000000">
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="44" />
        <ColumnDefinition Width="*" />
        <ColumnDefinition Width="Auto" />
      </Grid.ColumnDefinitions>
      <Border x:Name="border" HorizontalAlignment="Stretch" Margin="0" Width="Auto" Visibility="Collapsed" Background="{StaticResource ButtonHoverOuterBackgroundBrush}" BorderBrush="{StaticResource ButtonHoverOuterBorderBrush}" BorderThickness="1" CornerRadius="2" Grid.Column="0" Grid.ColumnSpan="3">
        <Border Background="{StaticResource ButtonHoverInnerBackgroundBrush}" BorderBrush="{StaticResource ButtonHoverInnerBorderBrush}" BorderThickness="1" CornerRadius="1" />
      </Border>
      <TextBlock x:Name="textBlock_Copy" Text="{TemplateBinding Header}" Width="Auto" Height="Auto" Margin="9,3,13,3" VerticalAlignment="Center" Grid.Column="1" TextTrimming="None" Visibility="Hidden" HorizontalAlignment="Left" />
      <TextBlock x:Name="textBlock" Text="{TemplateBinding Header}" Width="Auto" Height="Auto" Margin="9,3,3,3" VerticalAlignment="Center" Grid.Column="1" d:LayoutOverrides="Width" TextTrimming="CharacterEllipsis" />
      <Rectangle x:Name="rectangle" Fill="{StaticResource MenuItemCheckBoxBackgroundBrush}" Stroke="{StaticResource MenuItemCheckBoxBorderBrush}" Grid.ColumnSpan="1" HorizontalAlignment="Center" VerticalAlignment="Center" Width="40" Height="40" RadiusX="1" RadiusY="1" Visibility="Collapsed" />
      <Image x:Name="image" HorizontalAlignment="Center" VerticalAlignment="Center" Source="/Fluent;Component/Themes/Office2010/Images/Checked.png" Stretch="None" Visibility="Collapsed" SnapsToDevicePixels="True" />
      <ContentPresenter x:Name="iconImage" HorizontalAlignment="Center" Height="32" VerticalAlignment="Center" Content="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource StringToImageConvert}}" Width="32" Margin="3,2,2,2" SnapsToDevicePixels="True" />
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="IsChecked" Value="True">
        <Setter Property="Visibility" TargetName="rectangle" Value="Visible" />
      </Trigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="Icon" Value="{x:Null}" />
          <Condition Property="IsChecked" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="Visibility" TargetName="image" Value="Visible" />
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsHighlighted" Value="True" />
          <Condition Property="IsEnabled" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="Visibility" TargetName="border" Value="Visible" />
      </MultiTrigger>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="Opacity" TargetName="iconImage" Value="0.5" />
        <Setter Property="Opacity" TargetName="image" Value="0.5" />
        <Setter Property="Opacity" TargetName="textBlock" Value="0.5" />
        <Setter Property="Effect" TargetName="iconImage">
          <Setter.Value>
            <Fluent:GrayscaleEffect />
          </Setter.Value>
        </Setter>
        <Setter Property="Effect" TargetName="image">
          <Setter.Value>
            <Fluent:GrayscaleEffect />
          </Setter.Value>
        </Setter>
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <ControlTemplate x:Key="HeaderApplicationMenuItemTemplate" TargetType="{x:Type Fluent:MenuItem}">
    <ControlTemplate.Resources>
      <ResourceDictionary>
        <Style x:Key="{x:Type ScrollViewer}" TargetType="{x:Type ScrollViewer}" BasedOn="{StaticResource MenuScrollViewer}" />
        <Style x:Key="{x:Type Fluent:MenuItem}" TargetType="{x:Type Fluent:MenuItem}" BasedOn="{StaticResource ApplicationMenuSecondLevelStyle}" />
      </ResourceDictionary>
    </ControlTemplate.Resources>
    <Grid Width="Auto" Height="44" Background="#00000000">
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="44" />
        <ColumnDefinition Width="*" />
        <ColumnDefinition Width="Auto" />
      </Grid.ColumnDefinitions>
      <Border x:Name="border" HorizontalAlignment="Stretch" Margin="0" Width="Auto" Visibility="Collapsed" Background="{StaticResource ButtonHoverOuterBackgroundBrush}" BorderBrush="{StaticResource ButtonHoverOuterBorderBrush}" BorderThickness="1" CornerRadius="2" Grid.Column="0" Grid.ColumnSpan="3">
        <Border Background="{StaticResource ButtonHoverInnerBackgroundBrush}" BorderBrush="{StaticResource ButtonHoverInnerBorderBrush}" BorderThickness="1" CornerRadius="1" />
      </Border>
      <TextBlock x:Name="textBlock_Copy" Text="{TemplateBinding Header}" Width="Auto" Height="Auto" Margin="9,3,13,3" VerticalAlignment="Center" Grid.Column="1" TextTrimming="None" d:LayoutOverrides="Width" Visibility="Hidden" HorizontalAlignment="Left" />
      <TextBlock x:Name="textBlock" Text="{TemplateBinding Header}" Width="Auto" Height="Auto" Margin="9,3,3,3" VerticalAlignment="Center" Grid.Column="1" d:LayoutOverrides="Width" TextTrimming="CharacterEllipsis" />
      <Rectangle x:Name="rectangle" Fill="{StaticResource MenuItemCheckBoxBackgroundBrush}" Stroke="{StaticResource MenuItemCheckBoxBorderBrush}" Grid.ColumnSpan="1" HorizontalAlignment="Center" VerticalAlignment="Center" Width="40" Height="40" RadiusX="1" RadiusY="1" Visibility="Collapsed" />
      <Image x:Name="image" HorizontalAlignment="Center" VerticalAlignment="Center" Source="/Fluent;Component/Themes/Office2010/Images/Checked.png" Stretch="None" Visibility="Collapsed" SnapsToDevicePixels="True" />
      <ContentPresenter x:Name="iconImage" HorizontalAlignment="Center" Height="32" VerticalAlignment="Center" Content="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource StringToImageConvert}}" Width="32" Margin="3,2,2,2" SnapsToDevicePixels="True" />
      <Path x:Name="path" Stretch="Fill" Stroke="{x:Null}" HorizontalAlignment="Right" Margin="1,0,9,0" Width="4" Data="M0,0L1,1 0,2z" Height="7" Grid.Column="3">
        <Path.Fill>
          <LinearGradientBrush EndPoint="0.945,0.872" StartPoint="0.055,0.128">
            <GradientStop Color="#FF7C7C7C" Offset="1" />
            <GradientStop Color="#FF9E9E9E" />
          </LinearGradientBrush>
        </Path.Fill>
      </Path>
      <Popup x:Name="PART_Popup" Placement="Relative" PlacementTarget="{Binding Converter={StaticResource ApplicationMenuRightContentExtractorConvert}, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:ApplicationMenu}}}" IsOpen="{TemplateBinding IsSubmenuOpen}" AllowsTransparency="True" Focusable="False" PopupAnimation="Fade" Margin="0,0,0,0" VerticalAlignment="Top" Grid.ColumnSpan="2" Width="{Binding RightPaneWidth, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:ApplicationMenu}}}" Height="{Binding ActualHeight, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:MenuPanel}}}">
        <Grid Name="DropDown" SnapsToDevicePixels="True" Margin="0" VerticalAlignment="Stretch">
          <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="4" />
          </Grid.RowDefinitions>
          <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="4" />
          </Grid.ColumnDefinitions>
          <Rectangle HorizontalAlignment="Left" VerticalAlignment="Top" Width="4" Height="4" Grid.Row="1" Grid.Column="1" StrokeThickness="0" Margin="-1,-1,0,0">
            <Rectangle.Fill>
              <RadialGradientBrush RadiusX="0.984" Center="0.017,0.002" GradientOrigin="0.017,0.002" RadiusY="1">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="-1,3,0,0" VerticalAlignment="Top" Width="4" Height="4" Grid.Column="1" Grid.Row="0">
            <Rectangle.Fill>
              <RadialGradientBrush Center="0.032,1.01" GradientOrigin="0.032,1.01" RadiusX="0.984" RadiusY="1">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="3,-1,0,0" VerticalAlignment="Top" Width="4" Height="4" Grid.Column="0" Grid.Row="1">
            <Rectangle.Fill>
              <RadialGradientBrush Center="0.996,0.027" GradientOrigin="0.996,0.027" RadiusX="0.984" RadiusY="1">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Stretch" Margin="7,-1,1,0" VerticalAlignment="Top" Width="Auto" Height="4" Grid.Column="0" Grid.Row="1">
            <Rectangle.Fill>
              <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" MappingMode="RelativeToBoundingBox">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </LinearGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="-1,7,0,1" VerticalAlignment="Stretch" Width="4" Height="Auto" Grid.Column="1" Grid.Row="0">
            <Rectangle.Fill>
              <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5" MappingMode="RelativeToBoundingBox">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </LinearGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Border x:Name="DropDownBorder" SnapsToDevicePixels="True" Background="{StaticResource ContextMenuBarBackgroundBrush}" BorderBrush="{StaticResource ContextMenuBarBorderBrush}" BorderThickness="1" CornerRadius="2,2,1,1" Grid.ColumnSpan="1" d:LayoutOverrides="Width, Height" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
            <Grid Width="Auto" Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
              <Border VerticalAlignment="Stretch" Width="Auto" Height="Auto" BorderBrush="{StaticResource ContextMenuBarBackgroundBrush}" BorderThickness="1" CornerRadius="1" />
              <Grid Margin="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                <Grid.RowDefinitions>
                  <RowDefinition Height="*" />
                  <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" x:Name="PART_ScrollViewer" Margin="1" SnapsToDevicePixels="True">
                  <Fluent:MenuPanel x:Name="PART_MenuPanel" IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" />
                </ScrollViewer>
              </Grid>
            </Grid>
          </Border>
        </Grid>
      </Popup>
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="IsChecked" Value="True">
        <Setter Property="Visibility" TargetName="rectangle" Value="Visible" />
      </Trigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="Icon" Value="{x:Null}" />
          <Condition Property="IsChecked" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="Visibility" TargetName="image" Value="Visible" />
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsHighlighted" Value="True" />
          <Condition Property="IsEnabled" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="Visibility" TargetName="border" Value="Visible" />
      </MultiTrigger>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="Opacity" TargetName="iconImage" Value="0.5" />
        <Setter Property="Opacity" TargetName="image" Value="0.5" />
        <Setter Property="Opacity" TargetName="textBlock" Value="0.5" />
        <Setter Property="Effect" TargetName="iconImage">
          <Setter.Value>
            <Fluent:GrayscaleEffect />
          </Setter.Value>
        </Setter>
        <Setter Property="Effect" TargetName="image">
          <Setter.Value>
            <Fluent:GrayscaleEffect />
          </Setter.Value>
        </Setter>
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <ControlTemplate x:Key="SplitedApplicationMenuItemTemplate" TargetType="{x:Type Fluent:MenuItem}">
    <ControlTemplate.Resources>
      <ResourceDictionary>
        <Style x:Key="{x:Type ScrollViewer}" TargetType="{x:Type ScrollViewer}" BasedOn="{StaticResource MenuScrollViewer}" />
        <Style TargetType="{x:Type Fluent:MenuItem}" BasedOn="{StaticResource ApplicationMenuSecondLevelStyle}" />
      </ResourceDictionary>
    </ControlTemplate.Resources>
    <Grid Width="Auto" Height="44" Background="#00000000">
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="44" />
        <ColumnDefinition Width="*" />
        <ColumnDefinition Width="Auto" />
      </Grid.ColumnDefinitions>
      <Rectangle Grid.Column="2" HorizontalAlignment="Right" Margin="0,4,23,4" Stroke="{StaticResource WindowContentBorderBrush}" Width="1" />
      <Grid HorizontalAlignment="Stretch" Margin="0" Width="Auto" Grid.Column="0" Grid.ColumnSpan="3">
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="0.905*" />
          <ColumnDefinition x:Name="columnDefinition" Width="23" />
        </Grid.ColumnDefinitions>
        <Border x:Name="PART_ButtonBorder" Visibility="Collapsed" Background="{StaticResource ButtonHoverOuterBackgroundBrush}" BorderBrush="{StaticResource ButtonHoverOuterBorderBrush}" BorderThickness="1" CornerRadius="2" Margin="0,0,-1,0">
          <Border x:Name="border1" Background="{StaticResource ButtonHoverInnerBackgroundBrush}" BorderBrush="{StaticResource ButtonHoverInnerBorderBrush}" BorderThickness="1" CornerRadius="1" Grid.ColumnSpan="2" />
        </Border>
        <Border x:Name="border_Copy" HorizontalAlignment="Stretch" Margin="0" Width="Auto" Visibility="Collapsed" BorderBrush="{StaticResource ButtonHoverOuterBorderBrush}" BorderThickness="1" CornerRadius="2" Grid.Column="1" Background="{StaticResource TransparentBrush}">
          <Border x:Name="border1_Copy" Background="{StaticResource ButtonHoverInnerBackgroundBrush}" BorderBrush="{StaticResource ButtonHoverInnerBorderBrush}" BorderThickness="1" CornerRadius="1" Grid.ColumnSpan="1" d:CopyToken="09a4b798-0b8a-441e-b6c8-d7787f8d7e43" Visibility="Collapsed" />
        </Border>
      </Grid>
      <TextBlock x:Name="textBlock_Copy" Text="{TemplateBinding Header}" Width="Auto" Height="Auto" Margin="9,3,13,3" VerticalAlignment="Center" Grid.Column="1" TextTrimming="None" d:LayoutOverrides="Width" Visibility="Hidden" HorizontalAlignment="Left" />
      <TextBlock x:Name="textBlock" Text="{TemplateBinding Header}" Width="Auto" Height="Auto" Margin="9,3,3,3" VerticalAlignment="Center" Grid.Column="1" d:LayoutOverrides="Width" TextTrimming="CharacterEllipsis" />
      <Rectangle x:Name="rectangle" Fill="{StaticResource MenuItemCheckBoxBackgroundBrush}" Stroke="{StaticResource MenuItemCheckBoxBorderBrush}" Grid.ColumnSpan="1" HorizontalAlignment="Center" VerticalAlignment="Center" Width="40" Height="40" RadiusX="1" RadiusY="1" Visibility="Collapsed" />
      <Image x:Name="image" HorizontalAlignment="Center" VerticalAlignment="Center" Source="/Fluent;Component/Themes/Office2010/Images/Checked.png" Stretch="None" Visibility="Collapsed" SnapsToDevicePixels="True" />
      <ContentPresenter x:Name="iconImage" HorizontalAlignment="Center" Height="32" VerticalAlignment="Center" Content="{Binding Icon, Converter={StaticResource StringToImageConvert}, RelativeSource={RelativeSource TemplatedParent}}" Width="32" Margin="3,2,2,2" SnapsToDevicePixels="True" />
      <Path x:Name="path" Stretch="Fill" Stroke="{x:Null}" HorizontalAlignment="Right" Margin="1,0,9,0" Width="4" Data="M0,0L1,1 0,2z" Height="7" Grid.Column="3">
        <Path.Fill>
          <LinearGradientBrush EndPoint="0.945,0.872" StartPoint="0.055,0.128">
            <GradientStop Color="#FF7C7C7C" Offset="1" />
            <GradientStop Color="#FF9E9E9E" />
          </LinearGradientBrush>
        </Path.Fill>
      </Path>
      <Popup x:Name="PART_Popup" Placement="Relative" PlacementTarget="{Binding Converter={StaticResource ApplicationMenuRightContentExtractorConvert}, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:ApplicationMenu}}}" IsOpen="{TemplateBinding IsSubmenuOpen}" AllowsTransparency="True" Focusable="False" PopupAnimation="Fade" Margin="0,0,0,0" VerticalAlignment="Top" Grid.ColumnSpan="2" Width="{Binding RightPaneWidth, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:ApplicationMenu}}}" Height="{Binding ActualHeight, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:MenuPanel}}}">
        <Grid x:Name="DropDown" SnapsToDevicePixels="True" Margin="0" VerticalAlignment="Stretch">
          <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="4" />
          </Grid.RowDefinitions>
          <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="4" />
          </Grid.ColumnDefinitions>
          <Rectangle HorizontalAlignment="Left" VerticalAlignment="Top" Width="4" Height="4" Grid.Row="1" Grid.Column="1" StrokeThickness="0" Margin="-1,-1,0,0">
            <Rectangle.Fill>
              <RadialGradientBrush RadiusX="0.984" Center="0.017,0.002" GradientOrigin="0.017,0.002" RadiusY="1">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="-1,3,0,0" VerticalAlignment="Top" Width="4" Height="4" Grid.Column="1" Grid.Row="0">
            <Rectangle.Fill>
              <RadialGradientBrush Center="0.032,1.01" GradientOrigin="0.032,1.01" RadiusX="0.984" RadiusY="1">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="3,-1,0,0" VerticalAlignment="Top" Width="4" Height="4" Grid.Column="0" Grid.Row="1">
            <Rectangle.Fill>
              <RadialGradientBrush Center="0.996,0.027" GradientOrigin="0.996,0.027" RadiusX="0.984" RadiusY="1">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Stretch" Margin="7,-1,1,0" VerticalAlignment="Top" Width="Auto" Height="4" Grid.Column="0" Grid.Row="1">
            <Rectangle.Fill>
              <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" MappingMode="RelativeToBoundingBox">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </LinearGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="-1,7,0,1" VerticalAlignment="Stretch" Width="4" Height="Auto" Grid.Column="1" Grid.Row="0">
            <Rectangle.Fill>
              <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5" MappingMode="RelativeToBoundingBox">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </LinearGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Border x:Name="DropDownBorder" SnapsToDevicePixels="True" Background="{StaticResource ContextMenuBarBackgroundBrush}" BorderBrush="{StaticResource ContextMenuBarBorderBrush}" BorderThickness="1" CornerRadius="1" Grid.ColumnSpan="1" d:LayoutOverrides="Width, Height" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
            <Grid Width="Auto" Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
              <Border VerticalAlignment="Stretch" Width="Auto" Height="Auto" BorderBrush="{StaticResource ContextMenuBarBackgroundBrush}" BorderThickness="1" CornerRadius="1" />
              <Grid Margin="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                <Grid.RowDefinitions>
                  <RowDefinition Height="*" />
                  <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Path Fill="{x:Null}" Stretch="Fill" Stroke="#FFE2E4E7" HorizontalAlignment="Left" Margin="24,0,0,0" Width="1" Height="Auto" Data="M0,0L0,1" Grid.RowSpan="2" Visibility="Visible" />
                <ScrollViewer Margin="1" x:Name="PART_ScrollViewer" Style="{StaticResource MenuScrollViewer}" SnapsToDevicePixels="True">
                  <Fluent:MenuPanel x:Name="PART_MenuPanel" IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" />
                </ScrollViewer>
              </Grid>
            </Grid>
          </Border>
        </Grid>
      </Popup>
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="IsMouseOver" Value="True" SourceName="border_Copy">
        <Setter Property="Visibility" TargetName="border1_Copy" Value="Visible" />
      </Trigger>
      <Trigger Property="IsChecked" Value="True">
        <Setter Property="Visibility" TargetName="rectangle" Value="Visible" />
      </Trigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="Icon" Value="{x:Null}" />
          <Condition Property="IsChecked" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="Visibility" TargetName="image" Value="Visible" />
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsHighlighted" Value="True" />
          <Condition Property="IsEnabled" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="Visibility" TargetName="PART_ButtonBorder" Value="Visible" />
        <Setter Property="Visibility" TargetName="border_Copy" Value="Visible" />
      </MultiTrigger>
      <Trigger Property="IsSubmenuOpen" Value="True">
        <Setter Property="Visibility" TargetName="border1_Copy" Value="Visible" />
      </Trigger>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="Opacity" TargetName="iconImage" Value="0.5" />
        <Setter Property="Opacity" TargetName="image" Value="0.5" />
        <Setter Property="Opacity" TargetName="textBlock" Value="0.5" />
        <Setter Property="Effect" TargetName="iconImage">
          <Setter.Value>
            <Fluent:GrayscaleEffect />
          </Setter.Value>
        </Setter>
        <Setter Property="Effect" TargetName="image">
          <Setter.Value>
            <Fluent:GrayscaleEffect />
          </Setter.Value>
        </Setter>
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <Style x:Key="ApplicationMenuStyle" TargetType="{x:Type Fluent:MenuItem}">
    <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
    <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden" />
    <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}" />
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
    <Setter Property="Foreground" Value="{StaticResource DefaultFontBrush}" />
    <Setter Property="ResizeMode" Value="None" />
    <Setter Property="SnapsToDevicePixels" Value="True" />
    <Setter Property="Fluent:FrameworkHelper.UseLayoutRounding" Value="True" />
    <Setter Property="OverridesDefaultStyle" Value="True" />
    <Setter Property="Template" Value="{StaticResource ApplicationMenuItemTemplate}" />
    <Style.Triggers>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="Fluent:MenuItem.IsSplited" Value="True" />
          <Condition Property="HasItems" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="Template" Value="{StaticResource SplitedApplicationMenuItemTemplate}" />
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="Fluent:MenuItem.IsSplited" Value="False" />
          <Condition Property="HasItems" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="Template" Value="{StaticResource HeaderApplicationMenuItemTemplate}" />
      </MultiTrigger>
    </Style.Triggers>
  </Style>
  <ControlTemplate x:Key="ApplicationMenuButtonControlTemplate" TargetType="{x:Type Fluent:ApplicationMenu}">
    <ControlTemplate.Resources>
      <Style BasedOn="{StaticResource ApplicationMenuStyle}" TargetType="{x:Type Fluent:MenuItem}" />
    </ControlTemplate.Resources>
    <Grid Margin="0,0,0,0">
      <ContentControl x:Name="buttonContent" Width="{Binding ActualWidth, ElementName=PART_ButtonBorder}" Height="{Binding ActualHeight, ElementName=PART_ButtonBorder}" Margin="0,0,0,1">
        <Border x:Name="PART_ButtonBorder" MinWidth="56" Height="23" CornerRadius="2,2,0,0" Background="{TemplateBinding Background}">
          <Border x:Name="border1" BorderThickness="1,1,1,0" CornerRadius="2,2,0,0">
            <Border.BorderBrush>
              <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#997C7C7C" Offset="0" />
                <GradientStop Color="#7F848484" Offset="1" />
              </LinearGradientBrush>
            </Border.BorderBrush>
            <Border x:Name="border" BorderThickness="1,1,1,0" CornerRadius="1,1,0,0">
              <Border.BorderBrush>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                  <GradientStop Color="#72FFFFFF" Offset="0" />
                  <GradientStop Color="#4CFFFFFF" Offset="1" />
                </LinearGradientBrush>
              </Border.BorderBrush>
              <Border.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                  <GradientStop Color="#3FFFFFFF" Offset="0" />
                  <GradientStop Offset="1" Color="#3FFFFFFF" />
                  <GradientStop Offset="0.5" />
                </LinearGradientBrush>
              </Border.Background>
              <Grid>
                <Rectangle x:Name="rectangle_Copy" StrokeThickness="0">
                  <Rectangle.Fill>
                    <RadialGradientBrush Center="0.5,0.0" GradientOrigin="0.5,0.0" RadiusX="0.501" RadiusY="0.319">
                      <GradientStop Color="#59FFFFFF" />
                      <GradientStop Offset="1" />
                    </RadialGradientBrush>
                  </Rectangle.Fill>
                </Rectangle>
                <Rectangle x:Name="rectangle" StrokeThickness="0">
                  <Rectangle.Fill>
                    <RadialGradientBrush Center="0.5,1.001" GradientOrigin="0.5,1.001" RadiusX="0.496" RadiusY="0.554">
                      <GradientStop Color="#66FFFFFF" Offset="0.018" />
                      <GradientStop Offset="1" />
                    </RadialGradientBrush>
                  </Rectangle.Fill>
                </Rectangle>
                <!--<TextBlock Margin="2,0,2,2" Text="{TemplateBinding Header}" TextWrapping="Wrap" d:LayoutOverrides="Width, Height" HorizontalAlignment="Center" VerticalAlignment="Center"/>-->
                <ContentPresenter x:Name="contentPresenter" ContentSource="Header" VerticalAlignment="Center" HorizontalAlignment="Center" />
              </Grid>
            </Border>
          </Border>
        </Border>
      </ContentControl>
      <Popup x:Name="PART_Popup" Placement="Relative" PlacementTarget="{Binding ElementName=buttonContent}" IsOpen="{TemplateBinding IsDropDownOpen}" AllowsTransparency="True" Focusable="False" PopupAnimation="Fade" Margin="0,0,-4,0" VerticalAlignment="Top" Grid.ColumnSpan="2">
        <Grid Name="DropDown" SnapsToDevicePixels="True" Margin="0" VerticalAlignment="Top">
          <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="10" />
          </Grid.RowDefinitions>
          <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="10" />
          </Grid.ColumnDefinitions>
          <Rectangle HorizontalAlignment="Left" VerticalAlignment="Top" Width="4" Height="4" Grid.Row="1" Grid.Column="1" StrokeThickness="0" Margin="-1,-1,0,0">
            <Rectangle.Fill>
              <RadialGradientBrush RadiusX="0.984" Center="0.017,0.002" GradientOrigin="0.017,0.002" RadiusY="1">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="-1,3,0,0" VerticalAlignment="Top" Width="4" Height="4" Grid.Column="1" Grid.Row="0">
            <Rectangle.Fill>
              <RadialGradientBrush Center="0.032,1.01" GradientOrigin="0.032,1.01" RadiusX="0.984" RadiusY="1">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="3,-1,0,0" VerticalAlignment="Top" Width="4" Height="4" Grid.Column="0" Grid.Row="1">
            <Rectangle.Fill>
              <RadialGradientBrush Center="0.996,0.027" GradientOrigin="0.996,0.027" RadiusX="0.984" RadiusY="1">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Stretch" Margin="7,-1,1,0" VerticalAlignment="Top" Width="Auto" Height="4" Grid.Column="0" Grid.Row="1">
            <Rectangle.Fill>
              <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" MappingMode="RelativeToBoundingBox">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </LinearGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="-1,7,0,1" VerticalAlignment="Stretch" Width="4" Height="Auto" Grid.Column="1" Grid.Row="0">
            <Rectangle.Fill>
              <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5" MappingMode="RelativeToBoundingBox">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </LinearGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Border x:Name="PART_DropDownBorder" MinWidth="{TemplateBinding ActualWidth}" SnapsToDevicePixels="True" Background="{StaticResource ContextMenuBarBackgroundBrush}" BorderBrush="{StaticResource ContextMenuBarBorderBrush}" BorderThickness="1" CornerRadius="1" Grid.ColumnSpan="1" d:LayoutOverrides="Width, Height" HorizontalAlignment="Stretch" VerticalAlignment="Top">
            <Grid Width="Auto" Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Top">
              <Grid HorizontalAlignment="Stretch" VerticalAlignment="Top">
                <Grid.RowDefinitions>
                  <RowDefinition Height="Auto" />
                  <RowDefinition Height="*" />
                  <RowDefinition Height="Auto" MinHeight="17" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="Auto" MinWidth="100" />
                  <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Border Grid.Row="0" Grid.ColumnSpan="2" BorderThickness="0,0,0,1" BorderBrush="{StaticResource ContextMenuSeparatorBrush}" Margin="0" Background="{StaticResource RibbonBackgoundBrush}">
                  <ContentControl x:Name="buttonOnPopupContent" HorizontalAlignment="Left" Margin="-1,-1,0,0" />
                </Border>
                <Fluent:MenuPanel ScrollViewer.VerticalScrollBarVisibility="Auto" Grid.Row="1" Grid.Column="0" x:Name="PART_MenuPanel" IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle" />
                <Border Grid.Row="1" Grid.Column="1" BorderThickness="1,0,0,0" BorderBrush="{StaticResource ContextMenuSeparatorBrush}" Width="{TemplateBinding RightPaneWidth}" Background="{StaticResource GalleryBackgroundBrush}">
                  <ContentPresenter ContentSource="RightPaneContent" x:Name="PART_RightContentPresenter" />
                </Border>
                <Border Grid.Row="2" Grid.ColumnSpan="2" BorderThickness="0,1,0,0" BorderBrush="{StaticResource ContextMenuSeparatorBrush}" Background="{StaticResource RibbonBackgoundBrush}" Margin="0">
                  <ContentPresenter ContentSource="FooterPaneContent" />
                </Border>
              </Grid>
            </Grid>
          </Border>
        </Grid>
      </Popup>
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="Opacity" TargetName="PART_ButtonBorder" Value="0.5" />
        <Setter Property="Effect" TargetName="contentPresenter">
          <Setter.Value>
            <Fluent:GrayscaleEffect />
          </Setter.Value>
        </Setter>
      </Trigger>
      <Trigger Property="Header" Value="{x:Null}">
        <!--<Setter Property="Tag" TargetName="contentPresenter" Value="pack://application:,,,/Fluent;component\Themes\Office2010\Images\ApplicationMenu.png"/>
              <Setter Property="Content" TargetName="contentPresenter" Value="{Binding Tag, ElementName=contentPresenter, Converter={StaticResource StringToImageConvert}}"/>
              <Setter Property="Width" TargetName="contentPresenter" Value="{Binding Content.Source.Width, ElementName=contentPresenter}"/>
              <Setter Property="Height" TargetName="contentPresenter" Value="{Binding Content.Source.Height, ElementName=contentPresenter}"/>-->
        <Setter Property="Content" TargetName="contentPresenter">
          <Setter.Value>
            <Image Source="pack://application:,,,/Fluent;component\Themes\Office2010\Images\ApplicationMenu.png" VerticalAlignment="Center" HorizontalAlignment="Center" Stretch="None" />
          </Setter.Value>
        </Setter>
      </Trigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsMouseOver" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="BorderBrush" TargetName="border1">
          <Setter.Value>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
              <GradientStop Color="#A07C7C7C" Offset="0" />
              <GradientStop Color="#84848484" Offset="1" />
            </LinearGradientBrush>
          </Setter.Value>
        </Setter>
        <Setter Property="Background" TargetName="border">
          <Setter.Value>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
              <GradientStop Color="#4CFFFFFF" Offset="0" />
              <GradientStop Color="#25FFFFFF" Offset="1" />
              <GradientStop Offset="0.5" Color="#19FFFFFF" />
            </LinearGradientBrush>
          </Setter.Value>
        </Setter>
        <Setter Property="BorderBrush" TargetName="border">
          <Setter.Value>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
              <GradientStop Color="#7FFFFFFF" Offset="0" />
              <GradientStop Color="#59FFFFFF" Offset="1" />
            </LinearGradientBrush>
          </Setter.Value>
        </Setter>
        <Setter Property="Fill" TargetName="rectangle_Copy">
          <Setter.Value>
            <RadialGradientBrush Center="0.5,0" GradientOrigin="0.5,0" RadiusX="0.501" RadiusY="0.319">
              <GradientStop Color="#66FFFFFF" />
              <GradientStop Offset="1" />
            </RadialGradientBrush>
          </Setter.Value>
        </Setter>
        <Setter Property="Fill" TargetName="rectangle">
          <Setter.Value>
            <RadialGradientBrush Center="0.5,1.001" GradientOrigin="0.5,1.001" RadiusX="0.496" RadiusY="0.554">
              <GradientStop Color="#7FFFFFFF" Offset="0.018" />
              <GradientStop Offset="1" />
            </RadialGradientBrush>
          </Setter.Value>
        </Setter>
      </MultiTrigger>
      <Trigger Property="IsDropDownOpen" Value="True">
        <Setter Property="Content" TargetName="buttonContent" Value="{x:Null}" />
        <Setter Property="Content" TargetName="buttonOnPopupContent" Value="{Binding ElementName=PART_ButtonBorder}" />
        <Setter Property="CornerRadius" TargetName="PART_ButtonBorder" Value="0" />
        <Setter Property="CornerRadius" TargetName="border1" Value="0" />
        <Setter Property="CornerRadius" TargetName="border" Value="0" />
        <Setter Property="Visibility" TargetName="rectangle" Value="Collapsed" />
        <Setter Property="Visibility" TargetName="rectangle_Copy" Value="Collapsed" />
        <Setter Property="BorderBrush" TargetName="border1">
          <Setter.Value>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
              <GradientStop Color="#99A1A1A1" Offset="0" />
              <GradientStop Color="#7F9A9A9A" Offset="1" />
            </LinearGradientBrush>
          </Setter.Value>
        </Setter>
        <Setter Property="BorderBrush" TargetName="border">
          <Setter.Value>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
              <GradientStop Color="#4CFFFFFF" Offset="0" />
              <GradientStop Color="#72FFFFFF" Offset="1" />
            </LinearGradientBrush>
          </Setter.Value>
        </Setter>
        <Setter Property="Background" TargetName="border">
          <Setter.Value>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
              <GradientStop Color="#19FFFFFF" Offset="0" />
              <GradientStop Color="#66FFFFFF" Offset="1" />
              <GradientStop Offset="0.5" Color="#3FFFFFFF" />
            </LinearGradientBrush>
          </Setter.Value>
        </Setter>
      </Trigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsMouseOver" Value="True" SourceName="PART_ButtonBorder" />
          <Condition Property="IsDropDownOpen" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="Visibility" TargetName="rectangle" Value="Collapsed" />
        <Setter Property="Visibility" TargetName="rectangle_Copy" Value="Collapsed" />
        <Setter Property="BorderBrush" TargetName="border1">
          <Setter.Value>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
              <GradientStop Color="#A0A1A1A1" Offset="0" />
              <GradientStop Color="#879A9A9A" Offset="1" />
            </LinearGradientBrush>
          </Setter.Value>
        </Setter>
        <Setter Property="BorderBrush" TargetName="border">
          <Setter.Value>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
              <GradientStop Color="#59FFFFFF" Offset="0" />
              <GradientStop Color="#7FFFFFFF" Offset="1" />
            </LinearGradientBrush>
          </Setter.Value>
        </Setter>
        <Setter Property="Background" TargetName="border">
          <Setter.Value>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
              <GradientStop Color="#26FFFFFF" Offset="0" />
              <GradientStop Color="#7FFFFFFF" Offset="1" />
              <GradientStop Offset="0.5" Color="#4CFFFFFF" />
            </LinearGradientBrush>
          </Setter.Value>
        </Setter>
      </MultiTrigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <Style TargetType="{x:Type Fluent:ApplicationMenu}">
    <Setter Property="Template" Value="{StaticResource ApplicationMenuButtonControlTemplate}" />
    <Setter Property="Background" Value="Blue" />
    <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}" />
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
    <Setter Property="Foreground" Value="White" />
  </Style>
  <Style x:Key="RibbonTabControlStyle" TargetType="{x:Type Fluent:RibbonTabControl}">
    <Setter Property="VerticalAlignment" Value="Top" />
    <Setter Property="FocusManager.IsFocusScope" Value="False" />
    <Setter Property="Foreground" Value="{StaticResource DefaultFontBrush}" />
    <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}" />
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Fluent:RibbonTabControl}">
          <ControlTemplate.Resources>
            <!--Button in Scroll Control Style-->
            <ControlTemplate x:Key="ScrollButtonControlTemplate" TargetType="{x:Type RepeatButton}">
              <Border x:Name="border" BorderThickness="1" CornerRadius="2" BorderBrush="{StaticResource ScrollViewerButtonBorderBrush}" Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{StaticResource ScrollViewerButtonBackgroundBrush}">
                <Border x:Name="border1" Height="Auto" BorderBrush="{StaticResource TransparentBrush}" BorderThickness="1" CornerRadius="2" Background="{StaticResource TransparentBrush}">
                  <Grid Height="Auto">
                    <Rectangle x:Name="rectangle" StrokeThickness="0" Visibility="Collapsed">
                      <Rectangle.Fill>
                        <RadialGradientBrush Center="0.503,1" GradientOrigin="0.503,1" RadiusY="0.202">
                          <GradientStop Color="#7FFFFFFF" Offset="0" />
                          <GradientStop Offset="1" />
                        </RadialGradientBrush>
                      </Rectangle.Fill>
                    </Rectangle>
                    <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
                  </Grid>
                </Border>
              </Border>
              <ControlTemplate.Triggers>
                <Trigger Property="IsMouseOver" Value="False" />
                <Trigger Property="IsPressed" Value="True">
                  <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonPressedOuterBorderBrush}" />
                  <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonPressedOuterBackgroundBrush}" />
                  <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonPressedInnerBackgroundBrush}" />
                  <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonPressedInnerBorderBrush}" />
                </Trigger>
                <Trigger Property="IsEnabled" Value="False" />
                <MultiTrigger>
                  <MultiTrigger.Conditions>
                    <Condition Property="IsMouseOver" Value="True" />
                    <Condition Property="IsPressed" Value="False" />
                  </MultiTrigger.Conditions>
                  <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
                  <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
                  <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
                  <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
                  <Setter Property="Visibility" TargetName="rectangle" Value="Visible" />
                </MultiTrigger>
                <MultiTrigger>
                  <MultiTrigger.Conditions>
                    <Condition Property="IsKeyboardFocusWithin" Value="True" />
                    <Condition Property="IsPressed" Value="False" />
                  </MultiTrigger.Conditions>
                  <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
                  <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
                  <Setter Property="Background" TargetName="border" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
                  <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
                </MultiTrigger>
              </ControlTemplate.Triggers>
            </ControlTemplate>
            <Style x:Key="ScrollButtonStyle" TargetType="{x:Type RepeatButton}">
              <Setter Property="Template" Value="{StaticResource ScrollButtonControlTemplate}" />
              <Setter Property="Foreground" Value="{StaticResource DefaultFontBrush}" />
              <Setter Property="FocusVisualStyle" Value="{StaticResource ControlStyleEmptyFocus}" />
            </Style>
            <Style TargetType="{x:Type ScrollViewer}">
              <Setter Property="FocusManager.IsFocusScope" Value="False" />
              <Setter Property="Template">
                <Setter.Value>
                  <ControlTemplate TargetType="{x:Type ScrollViewer}">
                    <Grid x:Name="Grid" Background="{TemplateBinding Background}" IsHitTestVisible="True">
                      <ScrollContentPresenter Margin="{TemplateBinding Padding}" x:Name="PART_ScrollContentPresenter" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" CanContentScroll="{TemplateBinding CanContentScroll}" IsHitTestVisible="True" />
                      <RepeatButton Command="{x:Static ScrollBar.LineLeftCommand}" CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}" Focusable="false" HorizontalAlignment="Left" Width="13" Height="Auto" VerticalAlignment="Stretch" Style="{StaticResource ScrollButtonStyle}">
                        <RepeatButton.Visibility>
                          <MultiBinding FallbackValue="Visibility.Collapsed" Converter="{StaticResource MenuScrollingVisibilityConverter}" ConverterParameter="0">
                            <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="ComputedHorizontalScrollBarVisibility" />
                            <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="HorizontalOffset" />
                            <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="ExtentWidth" />
                            <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="ViewportWidth" />
                          </MultiBinding>
                        </RepeatButton.Visibility>
                        <Path Fill="Black" Stretch="Fill" Stroke="{x:Null}" StrokeThickness="0" HorizontalAlignment="Center" Margin="0" VerticalAlignment="Center" Width="3" Height="5" Data="M0,0L1,1 1,-1z" />
                      </RepeatButton>
                      <RepeatButton Command="{x:Static ScrollBar.LineRightCommand}" CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}" Focusable="false" HorizontalAlignment="Right" Width="13" Height="Auto" VerticalAlignment="Stretch" Style="{StaticResource ScrollButtonStyle}">
                        <RepeatButton.Visibility>
                          <MultiBinding FallbackValue="Visibility.Collapsed" Converter="{StaticResource MenuScrollingVisibilityConverter}" ConverterParameter="100">
                            <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="ComputedHorizontalScrollBarVisibility" />
                            <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="HorizontalOffset" />
                            <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="ExtentWidth" />
                            <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="ViewportWidth" />
                          </MultiBinding>
                        </RepeatButton.Visibility>
                        <Path Fill="Black" Stretch="Fill" Stroke="{x:Null}" StrokeThickness="0" HorizontalAlignment="Center" Margin="0" VerticalAlignment="Center" Width="3" Height="5" Data="M1,0L0,1 0,-1z" />
                      </RepeatButton>
                    </Grid>
                  </ControlTemplate>
                </Setter.Value>
              </Setter>
              <Setter Property="CanContentScroll" Value="True" />
              <Setter Property="HorizontalScrollBarVisibility" Value="Auto" />
              <Setter Property="VerticalScrollBarVisibility" Value="Disabled" />
            </Style>
          </ControlTemplate.Resources>
          <Grid x:Name="ContentGrid" Height="Auto" VerticalAlignment="Top">
            <Grid.RowDefinitions>
              <RowDefinition Height="24" />
              <RowDefinition x:Name="rowDefinition" Height="86" />
              <RowDefinition x:Name="rowDefinition1" Height="{TemplateBinding ContentGapHeight}" />
            </Grid.RowDefinitions>
            <Border x:Name="border" HorizontalAlignment="Stretch" Margin="0,-1,0,0" Width="Auto" BorderThickness="0,1" Grid.Row="1" BorderBrush="{Binding Path=SelectedItem.BorderBrush, RelativeSource={RelativeSource TemplatedParent}}" Background="{StaticResource RibbonBackgoundBrush}" />
            <Rectangle Margin="0,-1,0,0" Grid.Row="1" Width="50" Stroke="Black" Height="1" HorizontalAlignment="Left" VerticalAlignment="Top" StrokeThickness="1">
              <Rectangle.OpacityMask>
                <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                  <GradientStop Color="#66000000" Offset="0" />
                  <GradientStop Color="Transparent" Offset="1" />
                </LinearGradientBrush>
              </Rectangle.OpacityMask>
            </Rectangle>
            <Rectangle Margin="0,-1,0,0" Grid.Row="1" Width="50" Stroke="Black" Height="1" HorizontalAlignment="Right" VerticalAlignment="Top" StrokeThickness="1">
              <Rectangle.OpacityMask>
                <LinearGradientBrush EndPoint="0,0.5" StartPoint="1,0.5">
                  <GradientStop Color="#66000000" Offset="0" />
                  <GradientStop Color="Transparent" Offset="1" />
                </LinearGradientBrush>
              </Rectangle.OpacityMask>
            </Rectangle>
            <Border HorizontalAlignment="Stretch" Margin="1,0,1,1" Grid.Row="1" Grid.RowSpan="1">
              <ContentControl x:Name="mainContentControl" Margin="0,1,0,0" Focusable="False">
                <ContentPresenter ContentSource="SelectedContent" x:Name="contentPresenter" HorizontalAlignment="Stretch" Margin="0" />
              </ContentControl>
            </Border>
            <Border x:Name="shadowBorder" Margin="0,-1,0,0" VerticalAlignment="Stretch" Width="Auto" Grid.Row="2" Grid.RowSpan="1" BorderThickness="0,1,0,0" BorderBrush="{Binding Path=SelectedItem.BorderBrush, RelativeSource={RelativeSource TemplatedParent}}" Background="{Binding Path=SelectedItem.BorderBrush, RelativeSource={RelativeSource TemplatedParent}}">
              <Border.OpacityMask>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                  <GradientStop Color="Black" Offset="0.003" />
                  <GradientStop Color="#00000000" Offset="0.991" />
                  <GradientStop Color="#7F0A0A0A" Offset="0.16" />
                  <GradientStop Color="#FF040404" Offset="0.15" />
                </LinearGradientBrush>
              </Border.OpacityMask>
            </Border>
            <Border x:Name="shadowBorder_Copy" Margin="0,-1,0,0" VerticalAlignment="Stretch" Width="Auto" Grid.Row="2" Grid.RowSpan="1" BorderThickness="0,1,0,0" Background="Black" BorderBrush="Black" Opacity="0.3">
              <Border.OpacityMask>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                  <GradientStop Color="Black" Offset="0.003" />
                  <GradientStop Color="#00000000" Offset="0.991" />
                  <GradientStop Color="#7F0A0A0A" Offset="0.16" />
                  <GradientStop Color="#FF040404" Offset="0.15" />
                </LinearGradientBrush>
              </Border.OpacityMask>
            </Border>
            <Grid x:Name="TabsGrid" HorizontalAlignment="Stretch" Margin="0" Width="Auto" Grid.RowSpan="1">
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
              </Grid.ColumnDefinitions>
              <DockPanel LastChildFill="True">
                <ContentPresenter VerticalAlignment="Top" ContentSource="Menu" DockPanel.Dock="Left" />
                <Fluent:RibbonScrollViewer x:Name="scrollViewer" DockPanel.Dock="Right" HorizontalAlignment="Left" Margin="0,-7,1,0" Width="Auto" Style="{StaticResource RibbonTabScrollViewer}" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled" IsHitTestVisible="True">
                  <Fluent:RibbonTabsContainer x:Name="PART_TabsContainer" IsItemsHost="True" Height="Auto" HorizontalAlignment="Stretch" FocusManager.IsFocusScope="False" Margin="0" />
                </Fluent:RibbonScrollViewer>
              </DockPanel>
              <StackPanel x:Name="toolbarPlaceholder" HorizontalAlignment="Left" Grid.Column="1" Orientation="Horizontal" Margin="0,0,0,1">
                <Grid Width="22" Height="22">
                  <Image x:Name="image" Source="/Fluent;Component/Themes/Office2010/Images/RibbonPin.png" Stretch="None" Visibility="Collapsed" />
                  <Fluent:ToggleButton x:Name="PART_MinimizeButton" Margin="0" Width="22" Height="22" Size="Small" Style="{StaticResource RibbonTabControlToggleButtonStyle}" IsChecked="{Binding Path=IsMinimized, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Visibility="{TemplateBinding HasItems, Converter={StaticResource boolToVisibilityConverter}}" />
                </Grid>
                <StackPanel x:Name="PART_ToolbarPanel" Orientation="Horizontal" FocusManager.IsFocusScope="False" />
              </StackPanel>
            </Grid>
            <Popup x:Name="PART_Popup" PlacementTarget="{Binding Path=SelectedTabItem,RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}" StaysOpen="True" AllowsTransparency="True" PopupAnimation="Fade" VerticalOffset="-1" IsOpen="{TemplateBinding IsDropDownOpen}" HorizontalOffset="0" Placement="Custom">
              <Grid Width="Auto" Height="Auto" Margin="0,20">
                <Grid.RowDefinitions>
                  <RowDefinition Height="86" />
                  <RowDefinition Height="5" />
                </Grid.RowDefinitions>
                <Border Height="Auto" BorderBrush="{Binding Path=SelectedItem.BorderBrush, RelativeSource={RelativeSource TemplatedParent}}" Background="{StaticResource RibbonBackgoundBrush}" BorderThickness="0,1">
                  <ContentControl x:Name="contentControl" Margin="0" />
                </Border>
                <Border Margin="0,-1,0,0" VerticalAlignment="Bottom" Width="Auto" Grid.Row="1" Grid.RowSpan="1" BorderThickness="0,1,0,0" Height="6" BorderBrush="{Binding Path=SelectedItem.BorderBrush, RelativeSource={RelativeSource TemplatedParent}}" Background="{Binding Path=SelectedItem.BorderBrush, RelativeSource={RelativeSource TemplatedParent}}">
                  <Border.OpacityMask>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                      <GradientStop Color="Black" Offset="0.003" />
                      <GradientStop Color="#00000000" Offset="0.991" />
                      <GradientStop Color="#7F0A0A0A" Offset="0.16" />
                      <GradientStop Color="#FF040404" Offset="0.15" />
                    </LinearGradientBrush>
                  </Border.OpacityMask>
                </Border>
                <Border Margin="0" VerticalAlignment="Bottom" Width="Auto" Grid.Row="1" Grid.RowSpan="1" BorderThickness="0,1,0,0" Height="6" BorderBrush="Black" Background="Black" Opacity="0.3">
                  <Border.OpacityMask>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                      <GradientStop Color="Black" Offset="0.003" />
                      <GradientStop Color="#00000000" Offset="0.991" />
                      <GradientStop Color="#7F0A0A0A" Offset="0.16" />
                      <GradientStop Color="#FF040404" Offset="0.15" />
                    </LinearGradientBrush>
                  </Border.OpacityMask>
                </Border>
              </Grid>
            </Popup>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsMinimized" Value="True">
              <Setter Property="Height" TargetName="rowDefinition" Value="0" />
              <Setter Property="Height" TargetName="rowDefinition1" Value="0" />
              <Setter Property="Content" TargetName="mainContentControl" Value="{x:Null}" />
              <Setter Property="Content" TargetName="contentControl" Value="{Binding ElementName=contentPresenter, Mode=OneWay}" />
              <Setter Property="Visibility" TargetName="border" Value="Collapsed" />
              <Setter Property="Visibility" TargetName="shadowBorder" Value="Collapsed" />
              <Setter Property="Visibility" TargetName="image" Value="Collapsed" />
            </Trigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsDropDownOpen" Value="True" />
                <Condition Property="IsMinimized" Value="True" />
              </MultiTrigger.Conditions>
              <Setter Property="Visibility" TargetName="image" Value="Visible" />
              <Setter Property="Opacity" TargetName="PART_MinimizeButton" Value="0" />
            </MultiTrigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <ControlTemplate x:Key="RibbonGroupBoxDropDownButtonControlTemplate" TargetType="{x:Type Fluent:RibbonGroupBox}">
    <Grid Width="22">
      <Border x:Name="PART_ButtonBorder" BorderThickness="1" CornerRadius="2" Background="{StaticResource TransparentBrush}" BorderBrush="{StaticResource TransparentBrush}" Height="Auto" HorizontalAlignment="Left" VerticalAlignment="Stretch" d:LayoutOverrides="Width, Height">
        <Border x:Name="border1" Height="Auto" BorderBrush="{StaticResource TransparentBrush}" BorderThickness="1" CornerRadius="2" Background="{StaticResource TransparentBrush}">
          <Grid Height="Auto">
            <Rectangle x:Name="rectangle" StrokeThickness="0" Visibility="Collapsed">
              <Rectangle.Fill>
                <RadialGradientBrush Center="0.503,1" GradientOrigin="0.503,1" RadiusY="0.202">
                  <GradientStop Color="#7FFFFFFF" Offset="0" />
                  <GradientStop Offset="1" />
                </RadialGradientBrush>
              </Rectangle.Fill>
            </Rectangle>
            <StackPanel x:Name="stackPanel" Width="Auto" Orientation="Vertical" d:LayoutOverrides="Width, Height">
              <ContentPresenter x:Name="iconImage" HorizontalAlignment="Center" Height="16" VerticalAlignment="Center" Content="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource StringToImageConvert}}" Width="16" Margin="1,1,0,0" SnapsToDevicePixels="True" />
              <Fluent:TwoLineLabel Visibility="Collapsed" x:Name="controlLabel" Text="{TemplateBinding Header}" Style="{StaticResource TwoLineLabelStyle}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2,-2,2,2" />
            </StackPanel>
          </Grid>
        </Border>
      </Border>
      <Popup x:Name="PART_Popup" Placement="Bottom" IsOpen="{TemplateBinding IsDropDownOpen}" AllowsTransparency="True" Focusable="False" PopupAnimation="Fade" Margin="0,0,-4,0" VerticalAlignment="Top" Grid.ColumnSpan="2">
        <Grid Width="Auto" Height="Auto" Margin="0,20">
          <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="5" />
          </Grid.ColumnDefinitions>
          <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="5" />
          </Grid.RowDefinitions>
          <Rectangle Stroke="{x:Null}" StrokeThickness="0" HorizontalAlignment="Stretch" Margin="11,-1,1,0" VerticalAlignment="Stretch" Height="Auto" Grid.Column="0" Grid.Row="1" Grid.RowSpan="1">
            <Rectangle.Fill>
              <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" MappingMode="RelativeToBoundingBox">
                <GradientStop Color="#7F000000" Offset="0" />
                <GradientStop Offset="1" />
              </LinearGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle Stroke="{x:Null}" StrokeThickness="0" HorizontalAlignment="Stretch" Margin="-1,11,0,1" VerticalAlignment="Stretch" Height="Auto" Grid.Column="1" Grid.Row="0" Grid.RowSpan="1">
            <Rectangle.Fill>
              <LinearGradientBrush EndPoint="1.002,0" MappingMode="RelativeToBoundingBox">
                <GradientStop Color="#7F000000" Offset="0" />
                <GradientStop Offset="1" />
              </LinearGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle Stroke="{x:Null}" StrokeThickness="0" HorizontalAlignment="Stretch" Margin="-1,-1,0,0" VerticalAlignment="Stretch" Height="Auto" Grid.Column="1" Grid.Row="1" Grid.RowSpan="1">
            <Rectangle.Fill>
              <RadialGradientBrush Center="-0.003,0.011" GradientOrigin="-0.003,0.011" RadiusX="1.006" RadiusY="1">
                <GradientStop Color="#7F000000" Offset="0.002" />
                <GradientStop Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle Stroke="{x:Null}" StrokeThickness="0" HorizontalAlignment="Stretch" Margin="-1,5,0,0" VerticalAlignment="Top" Height="6" Grid.Column="1" Grid.Row="0" Grid.RowSpan="1">
            <Rectangle.Fill>
              <RadialGradientBrush Center="-0.01,1.004" GradientOrigin="-0.01,1.004" RadiusX="1.006" RadiusY="1">
                <GradientStop Color="#7F000000" Offset="0.002" />
                <GradientStop Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle Stroke="{x:Null}" StrokeThickness="0" HorizontalAlignment="Left" Margin="5,-1,0,0" VerticalAlignment="Stretch" Height="Auto" Grid.Column="0" Grid.Row="1" Grid.RowSpan="1" Width="6">
            <Rectangle.Fill>
              <RadialGradientBrush Center="1.003,-0.006" GradientOrigin="1.003,-0.006" RadiusX="1.006" RadiusY="1">
                <GradientStop Color="#7F000000" Offset="0.002" />
                <GradientStop Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Border x:Name="border" Height="Auto" Grid.RowSpan="1" Background="{StaticResource RibbonBackgoundBrush}" BorderBrush="{StaticResource RibbonTopBorderBrush}" BorderThickness="1" CornerRadius="1" d:LayoutOverrides="Width">
            <Grid x:Name="PART_ParentPanel" Margin="0,1,0,2" Grid.RowSpan="2" Height="85">
              <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="17" />
              </Grid.RowDefinitions>
              <Grid x:Name="PART_DownGrid" Margin="0,-2,2,2" Grid.Row="1" VerticalAlignment="Bottom" Height="17" MaxWidth="{Binding ActualWidth, ElementName=PART_UpPanel}">
                <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="*" />
                  <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <TextBlock HorizontalAlignment="Stretch" VerticalAlignment="Center" Text="{TemplateBinding Header}" TextWrapping="NoWrap" Grid.Row="1" Foreground="{StaticResource GroupBoxFontBrush}" Margin="2,0" TextTrimming="CharacterEllipsis" TextAlignment="Center" />
                <Fluent:Button Margin="0,0,1,1" x:Name="PART_DialogLauncherButton" HorizontalAlignment="Stretch" Width="15" Height="14" Grid.Column="1" Focusable="False" IsTabStop="False" Template="{StaticResource DialogLauncherButtonControlTemplate}" VerticalAlignment="Bottom" Icon="{TemplateBinding LauncherIcon}" Header="{TemplateBinding LauncherText}" Command="{Binding LauncherCommand, RelativeSource={RelativeSource TemplatedParent}}" CommandTarget="{Binding LauncherCommandTarget, RelativeSource={RelativeSource TemplatedParent}}" CommandParameter="{Binding LauncherCommandParameter, RelativeSource={RelativeSource TemplatedParent}}" ToolTip="{Binding LauncherToolTip, RelativeSource={RelativeSource TemplatedParent}}" IsEnabled="{Binding IsLauncherEnabled, RelativeSource={RelativeSource TemplatedParent}}" />
              </Grid>
              <WrapPanel x:Name="PART_UpPanel" HorizontalAlignment="Left" VerticalAlignment="Stretch" Width="Auto" Height="Auto" IsItemsHost="True" Margin="2,0,4,0" Orientation="Vertical" FocusManager.IsFocusScope="False" />
            </Grid>
          </Border>
        </Grid>
      </Popup>
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="State" Value="Collapsed">
        <Setter Property="Orientation" TargetName="stackPanel" Value="Horizontal" />
        <Setter Property="Content" TargetName="iconImage" Value="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource StringToImageConvert}}" />
        <Setter Property="HasTwoLines" TargetName="controlLabel" Value="False" />
        <Setter Property="Text" TargetName="controlLabel" Value="" />
        <Setter Property="Width" TargetName="iconImage" Value="16" />
        <Setter Property="Height" TargetName="iconImage" Value="16" />
        <Setter Property="Margin" TargetName="iconImage" Value="1,0,0,0" />
        <Setter Property="Margin" TargetName="controlLabel" Value="-2,-1,2,1" />
        <Setter Property="Width" TargetName="controlLabel" Value="10" />
        <Setter Property="VerticalAlignment" TargetName="controlLabel" Value="Center" />
      </Trigger>
      <Trigger Property="IsDropDownOpen" Value="True">
        <Setter Property="BorderBrush" TargetName="PART_ButtonBorder" Value="{StaticResource ButtonPressedOuterBorderBrush}" />
        <Setter Property="Background" TargetName="PART_ButtonBorder" Value="{StaticResource ButtonPressedOuterBackgroundBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonPressedInnerBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonPressedInnerBorderBrush}" />
        <Setter Property="Visibility" TargetName="rectangle" Value="Visible" />
      </Trigger>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="Opacity" TargetName="iconImage" Value="0.5" />
        <Setter Property="Opacity" TargetName="controlLabel" Value="0.5" />
        <Setter Property="Effect" TargetName="iconImage">
          <Setter.Value>
            <Fluent:GrayscaleEffect />
          </Setter.Value>
        </Setter>
      </Trigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsMouseOver" Value="True" />
          <Condition Property="IsDropDownOpen" Value="False" />
        </MultiTrigger.Conditions>
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
        <Setter Property="Background" TargetName="PART_ButtonBorder" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="PART_ButtonBorder" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
        <Setter Property="Visibility" TargetName="rectangle" Value="Visible" />
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsFocused" Value="True" />
          <Condition Property="IsDropDownOpen" Value="False" />
        </MultiTrigger.Conditions>
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
        <Setter Property="Background" TargetName="PART_ButtonBorder" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="PART_ButtonBorder" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
        <Setter Property="Visibility" TargetName="rectangle" Value="Visible" />
      </MultiTrigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <Style x:Key="RibbonToggleButtonStyle" TargetType="{x:Type Fluent:ToggleButton}">
    <Setter Property="Template" Value="{StaticResource RibbonToggleButtonControlTemplate}" />
    <Setter Property="Height" Value="68" />
    <Setter Property="Width" Value="Auto" />
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
    <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}" />
    <Setter Property="Foreground" Value="{StaticResource DefaultFontBrush}" />
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlStyleEmptyFocus}" />
    <Style.Triggers>
      <Trigger Property="Fluent:RibbonControl.Size" Value="Large">
        <Setter Property="Height" Value="68" />
      </Trigger>
      <Trigger Property="Fluent:RibbonControl.Size" Value="Middle">
        <Setter Property="Height" Value="22" />
      </Trigger>
      <Trigger Property="Fluent:RibbonControl.Size" Value="Small">
        <Setter Property="Height" Value="22" />
        <Setter Property="Width" Value="22" />
      </Trigger>
    </Style.Triggers>
  </Style>
  <Style x:Key="InnerButtonStyle" TargetType="{x:Type Fluent:ToggleButton}">
    <Setter Property="Template" Value="{StaticResource InnerButtonControlTemplate}" />
    <Setter Property="VerticalAlignment" Value="Stretch" />
    <Setter Property="HorizontalAlignment" Value="Stretch" />
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlStyleEmptyFocus}" />
  </Style>
  <Style x:Key="ScrollViewerStyle" TargetType="{x:Type ScrollViewer}">
    <Style.Triggers>
      <Trigger Property="IsEnabled" Value="false">
        <Setter Property="Foreground" Value="{StaticResource {x:Static SystemColors.GrayTextBrushKey}}" />
      </Trigger>
    </Style.Triggers>
    <Setter Property="Template" Value="{StaticResource ScrollViewerControlTemplate}" />
  </Style>
  <Style x:Key="RibbonContextualTabGroupStyle" TargetType="{x:Type Fluent:RibbonContextualTabGroup}">
    <Setter Property="Template" Value="{StaticResource RibbonContextualTabGroupControlTemplate1}" />
    <Setter Property="Width" Value="Auto" />
    <Setter Property="HorizontalAlignment" Value="Stretch" />
    <Setter Property="Focusable" Value="False" />
  </Style>
  <Style x:Key="ToolbarDropDownButtonStyle" TargetType="{x:Type Fluent:DropDownButton}">
    <Setter Property="Template" Value="{StaticResource ToolbarDropDownButtonControlTemplate}" />
    <Setter Property="Height" Value="22" />
    <Setter Property="Width" Value="13" />
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
    <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}" />
    <Setter Property="Foreground" Value="{StaticResource DefaultFontBrush}" />
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlStyleEmptyFocus}" />
  </Style>
  <Style x:Key="MenuSeparatorStyle" TargetType="{x:Type Separator}">
    <Setter Property="Template" Value="{StaticResource MenuSeparatorControlTemplate}" />
  </Style>
  <Style x:Key="{x:Static MenuItem.SeparatorStyleKey}" TargetType="{x:Type Separator}">
    <Setter Property="Template" Value="{StaticResource MenuSeparatorControlTemplate}" />
  </Style>
  <Style TargetType="Fluent:RibbonMenu">
    <Setter Property="Focusable" Value="False" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="Fluent:RibbonMenu">
          <ControlTemplate.Resources>
            <Style BasedOn="{StaticResource MenuSeparatorStyle}" TargetType="{x:Type Separator}" />
          </ControlTemplate.Resources>
          <Grid>
            <Rectangle Fill="{x:Null}" Stretch="Fill" Stroke="#FFE2E4E7" HorizontalAlignment="Left" Margin="24,0,0,0" Width="1" Height="Auto" Grid.RowSpan="2" Visibility="Visible" />
            <Fluent:MenuPanel x:Name="menuPanel" IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Continue" />
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="GalleryStyle" TargetType="{x:Type Fluent:Gallery}">
    <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
    <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Fluent:Gallery}">
          <ControlTemplate.Resources>
            <ResourceDictionary>
              <Style x:Key="{x:Type ScrollViewer}" TargetType="{x:Type ScrollViewer}" BasedOn="{StaticResource ScrollViewerStyle}" />
              <Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}" BasedOn="{StaticResource ScrollBarWhite}" />
            </ResourceDictionary>
          </ControlTemplate.Resources>
          <Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{StaticResource GalleryBorderBrush}" x:Name="layoutRoot">
            <Grid Width="Auto">
              <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
              </Grid.RowDefinitions>
              <Border x:Name="border" BorderBrush="{x:Null}" BorderThickness="0" Height="13" Background="{StaticResource GalleryHeaderBackgroundBrush}">
                <Fluent:DropDownButton x:Name="PART_DropDownButton" Style="{StaticResource GalleryDropDownButtonStyle}" Height="Auto" HorizontalAlignment="Left" VerticalAlignment="Top" Header="{TemplateBinding SelectedFilterTitle}" />
              </Border>
              <ScrollViewer x:Name="scrollViewer" Grid.RowSpan="1" Grid.Row="1" Margin="1" Focusable="False">
                <Fluent:GalleryPanel Background="White" MinItemsInRow="{TemplateBinding MinItemsInRow}" MaxItemsInRow="{TemplateBinding MaxItemsInRow}" Filter="{TemplateBinding SelectedFilterGroups}" ItemContainerGenerator="{Binding ItemContainerGenerator, RelativeSource={RelativeSource TemplatedParent}}" GroupBy="{TemplateBinding GroupBy}" IsItemsHost="True" ItemHeight="{TemplateBinding ItemHeight}" ItemWidth="{TemplateBinding ItemWidth}" Orientation="{TemplateBinding Orientation}" />
              </ScrollViewer>
            </Grid>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="HasFilter" Value="False">
              <Setter Property="Visibility" TargetName="border" Value="Collapsed" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="Margin" Value="0" />
    <Setter Property="BorderThickness" Value="0,0,0,1" />
    <Style.Triggers>
      <Trigger Property="IsLastItem" Value="True">
        <Setter Property="BorderThickness" Value="0" />
      </Trigger>
      <Trigger Property="Orientation" Value="Vertical">
        <Setter Property="ItemsPanel">
          <Setter.Value>
            <ItemsPanelTemplate>
              <StackPanel Orientation="Vertical" />
            </ItemsPanelTemplate>
          </Setter.Value>
        </Setter>
      </Trigger>
      <Trigger Property="Orientation" Value="Horizontal">
        <Setter Property="ItemsPanel">
          <Setter.Value>
            <ItemsPanelTemplate>
              <WrapPanel Orientation="Horizontal" />
            </ItemsPanelTemplate>
          </Setter.Value>
        </Setter>
      </Trigger>
    </Style.Triggers>
  </Style>
  <Style x:Key="InRibbonGalleryToggleButtonStyle" TargetType="{x:Type Fluent:ToggleButton}">
    <Setter Property="Template" Value="{StaticResource InRibbonGalleryToggleButtonControlTemplate}" />
    <Setter Property="Height" Value="68" />
    <Setter Property="Width" Value="Auto" />
    <Setter Property="Focusable" Value="False" />
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
    <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}" />
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlStyleEmptyFocus}" />
    <Setter Property="Foreground" Value="{StaticResource DefaultFontBrush}" />
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlStyleEmptyFocus}" />
    <Style.Triggers>
      <Trigger Property="Size" Value="Large">
        <Setter Property="Height" Value="68" />
      </Trigger>
      <Trigger Property="Size" Value="Middle">
        <Setter Property="Height" Value="22" />
      </Trigger>
      <Trigger Property="Size" Value="Small">
        <Setter Property="Height" Value="22" />
        <Setter Property="Width" Value="31" />
      </Trigger>
    </Style.Triggers>
  </Style>
  <Style x:Key="{x:Type Fluent:InRibbonGallery}" TargetType="{x:Type Fluent:InRibbonGallery}">
    <Style.Triggers>
      <Trigger Property="IsCollapsed" Value="True">
        <Setter Property="Margin" Value="0" />
      </Trigger>
    </Style.Triggers>
    <Setter Property="Focusable" Value="False" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Fluent:InRibbonGallery}">
          <Grid Width="Auto" Height="Auto" x:Name="PART_LayoutRoot" HorizontalAlignment="Stretch" VerticalAlignment="Top">
            <Border Width="Auto" BorderThickness="1,1,1,1" CornerRadius="0,1,1,0" BorderBrush="{StaticResource InRibbonGalleryBorderBrush}" ClipToBounds="True" Margin="0,0,0,0" x:Name="border" Height="60" HorizontalAlignment="Stretch" VerticalAlignment="Top">
              <Grid Width="Auto" Height="Auto">
                <ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Visible">
                  <ScrollViewer.Resources>
                    <Style TargetType="{x:Type ScrollBar}">
                      <Setter Property="Template">
                        <Setter.Value>
                          <ControlTemplate TargetType="{x:Type ScrollBar}">
                            <StackPanel HorizontalAlignment="Right" Margin="0,-1,-1,0">
                              <RepeatButton x:Name="upButton" Width="15" Height="21" Command="ScrollBar.PageUpCommand" Margin="0,0,0,0" Style="{StaticResource InRibbonGalleryRepeatButton}">
                                <Path RenderOptions.EdgeMode="Aliased" Data="M0,0 L1,-1 2,0z" Fill="Black" Width="5" Height="3" Stretch="Fill" />
                              </RepeatButton>
                              <RepeatButton x:Name="downButton" Width="15" Height="21" Command="ScrollBar.PageDownCommand" Margin="0,-1,0,0" Style="{StaticResource InRibbonGalleryRepeatButton}">
                                <Path RenderOptions.EdgeMode="Aliased" Data="M0,0 L1,1 2,0z" Fill="Black" Width="5" Height="3" Stretch="Fill" />
                              </RepeatButton>
                            </StackPanel>
                          </ControlTemplate>
                        </Setter.Value>
                      </Setter>
                      <Setter Property="ContextMenu" Value="{x:Null}" />
                    </Style>
                  </ScrollViewer.Resources>
                  <Grid>
                    <ContentControl x:Name="PART_ContentPresenter" Focusable="False">
                      <Fluent:GalleryPanel x:Name="PART_GalleryPanel" Background="White" ItemContainerGenerator="{Binding ItemContainerGenerator, RelativeSource={RelativeSource TemplatedParent}}" IsItemsHost="True" ItemHeight="{TemplateBinding ItemHeight}" ItemWidth="{TemplateBinding ItemWidth}" Orientation="{TemplateBinding Orientation}" Filter="{TemplateBinding SelectedFilterGroups}" GroupBy="{TemplateBinding GroupBy}" IsGrouped="False" />
                    </ContentControl>
                    <Image x:Name="PART_FakeImage" Visibility="Collapsed" />
                  </Grid>
                </ScrollViewer>
                <Fluent:ToggleButton IsDefinitive="False" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="15" Height="20" x:Name="PART_ExpandButton" Style="{StaticResource InRibbonGalleryButton}" Margin="0,0,-1,-1" ClickMode="Press" CanAddToQuickAccessToolBar="False" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource = {RelativeSource TemplatedParent}}" />
                <Popup x:Name="PART_Popup" Placement="Relative" PlacementTarget="{Binding ElementName=PART_LayoutRoot}" IsOpen="{TemplateBinding IsDropDownOpen}" AllowsTransparency="True" Focusable="False" PopupAnimation="Fade" Margin="0,0,-4,0" VerticalAlignment="Top" Grid.ColumnSpan="2">
                  <Popup.Resources>
                    <ResourceDictionary>
                      <Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}" BasedOn="{StaticResource ScrollBarWhite}" />
                    </ResourceDictionary>
                  </Popup.Resources>
                  <Grid Name="DropDown" SnapsToDevicePixels="True" Margin="0" VerticalAlignment="Top">
                    <Grid.RowDefinitions>
                      <RowDefinition Height="*" />
                      <RowDefinition Height="10" />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                      <ColumnDefinition Width="*" />
                      <ColumnDefinition Width="10" />
                    </Grid.ColumnDefinitions>
                    <Rectangle HorizontalAlignment="Left" VerticalAlignment="Top" Width="4" Height="4" Grid.Row="1" Grid.Column="1" StrokeThickness="0" Margin="-1,-1,0,0">
                      <Rectangle.Fill>
                        <RadialGradientBrush RadiusX="0.984" Center="0.017,0.002" GradientOrigin="0.017,0.002" RadiusY="1">
                          <GradientStop Color="#3F000000" Offset="0" />
                          <GradientStop Color="#00000000" Offset="1" />
                        </RadialGradientBrush>
                      </Rectangle.Fill>
                    </Rectangle>
                    <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="-1,3,0,0" VerticalAlignment="Top" Width="4" Height="4" Grid.Column="1" Grid.Row="0">
                      <Rectangle.Fill>
                        <RadialGradientBrush Center="0.032,1.01" GradientOrigin="0.032,1.01" RadiusX="0.984" RadiusY="1">
                          <GradientStop Color="#3F000000" Offset="0" />
                          <GradientStop Color="#00000000" Offset="1" />
                        </RadialGradientBrush>
                      </Rectangle.Fill>
                    </Rectangle>
                    <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="3,-1,0,0" VerticalAlignment="Top" Width="4" Height="4" Grid.Column="0" Grid.Row="1">
                      <Rectangle.Fill>
                        <RadialGradientBrush Center="0.996,0.027" GradientOrigin="0.996,0.027" RadiusX="0.984" RadiusY="1">
                          <GradientStop Color="#3F000000" Offset="0" />
                          <GradientStop Color="#00000000" Offset="1" />
                        </RadialGradientBrush>
                      </Rectangle.Fill>
                    </Rectangle>
                    <Rectangle StrokeThickness="0" HorizontalAlignment="Stretch" Margin="7,-1,1,0" VerticalAlignment="Top" Width="Auto" Height="4" Grid.Column="0" Grid.Row="1">
                      <Rectangle.Fill>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" MappingMode="RelativeToBoundingBox">
                          <GradientStop Color="#3F000000" Offset="0" />
                          <GradientStop Color="#00000000" Offset="1" />
                        </LinearGradientBrush>
                      </Rectangle.Fill>
                    </Rectangle>
                    <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="-1,7,0,1" VerticalAlignment="Stretch" Width="4" Height="Auto" Grid.Column="1" Grid.Row="0">
                      <Rectangle.Fill>
                        <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5" MappingMode="RelativeToBoundingBox">
                          <GradientStop Color="#3F000000" Offset="0" />
                          <GradientStop Color="#00000000" Offset="1" />
                        </LinearGradientBrush>
                      </Rectangle.Fill>
                    </Rectangle>
                    <Border x:Name="PART_DropDownBorder" MinWidth="{Binding ActualWidth, ElementName=PART_LayoutRoot}" SnapsToDevicePixels="True" Background="{StaticResource ContextMenuBarBackgroundBrush}" BorderBrush="{StaticResource ContextMenuBarBorderBrush}" BorderThickness="1" CornerRadius="1" Grid.ColumnSpan="1" HorizontalAlignment="Stretch" VerticalAlignment="Top">
                      <Grid Width="Auto" Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Top" KeyboardNavigation.DirectionalNavigation="Cycle">
                        <Border VerticalAlignment="Stretch" Width="Auto" Height="Auto" BorderBrush="{StaticResource ContextMenuBarBackgroundBrush}" BorderThickness="1" CornerRadius="1" />
                        <Grid Margin="1" HorizontalAlignment="Stretch" VerticalAlignment="Top">
                          <Grid.RowDefinitions>
                            <RowDefinition Height="*" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                          </Grid.RowDefinitions>
                          <Rectangle Fill="{x:Null}" Stretch="Fill" Stroke="#FFE2E4E7" HorizontalAlignment="Left" Margin="24,0,0,0" Width="1" Height="Auto" Grid.RowSpan="2" Visibility="Visible" VerticalAlignment="Stretch" />
                          <Grid x:Name="PART_MenuPanel" MinWidth="{Binding MinWidth, ElementName=PART_DropDownBorder}" MaxHeight="{TemplateBinding MaxDropDownHeight}" VerticalAlignment="Top">
                            <Grid.RowDefinitions>
                              <RowDefinition Height="*" />
                              <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{StaticResource GalleryBorderBrush}" x:Name="layoutRoot">
                              <Grid Width="Auto">
                                <Grid.RowDefinitions>
                                  <RowDefinition Height="Auto" />
                                  <RowDefinition Height="*" />
                                </Grid.RowDefinitions>
                                <Border Grid.Row="0" x:Name="border_" BorderBrush="{x:Null}" BorderThickness="0" Height="13" Background="{StaticResource GalleryHeaderBackgroundBrush}">
                                  <Fluent:DropDownButton x:Name="PART_FilterDropDownButton" Style="{StaticResource GalleryDropDownButtonStyle}" Height="Auto" HorizontalAlignment="Left" VerticalAlignment="Top" Header="{TemplateBinding SelectedFilterTitle}" />
                                </Border>
                                <ScrollViewer x:Name="PART_ScrollViewer" Grid.Row="1" MinHeight="{Binding ActualHeight, ElementName=PART_LayoutRoot}" BorderBrush="{StaticResource GalleryBorderBrush}" BorderThickness="0,0,0,1" Margin="1">
                                  <ContentControl x:Name="PART_PopupContentPresenter" Content="{x:Null}" />
                                </ScrollViewer>
                              </Grid>
                            </Border>
                            <ContentPresenter x:Name="menuPresenter" ContentSource="Menu" Grid.Row="1" KeyboardNavigation.DirectionalNavigation="None" VerticalAlignment="Top" />
                          </Grid>
                          <Border x:Name="resizeBorder" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="11" BorderBrush="{StaticResource ContextMenuBarResizeBorderBrush}" BorderThickness="0,1,0,0" Grid.Row="2" CornerRadius="0,0,1,1" Background="{StaticResource ContextMenuBarResizeBackgoundBrush}">
                            <Grid>
                              <Thumb x:Name="PART_ResizeVerticalThumb" HorizontalAlignment="Stretch" Margin="0,0,0,-90" Width="Auto" Height="10" VerticalAlignment="Top" Cursor="SizeNS" Template="{StaticResource ResizeVerticalThumbControlTemplate}" />
                              <Thumb x:Name="PART_ResizeBothThumb" HorizontalAlignment="Right" Margin="0,0,0,-90" Width="10" Height="10" VerticalAlignment="Top" Cursor="SizeNWSE" Template="{StaticResource ResizeBothThumbControlTemplate}" />
                            </Grid>
                          </Border>
                        </Grid>
                      </Grid>
                    </Border>
                  </Grid>
                </Popup>
              </Grid>
            </Border>
            <Fluent:ToggleButton IsDefinitive="False" Margin="0,0,0,0" Visibility="Collapsed" x:Name="PART_DropDownButton" Icon="{Binding Path=Icon, RelativeSource={RelativeSource TemplatedParent}}" LargeIcon="{Binding Path=LargeIcon, RelativeSource={RelativeSource TemplatedParent}}" Header="{Binding Path=Header, RelativeSource={RelativeSource TemplatedParent}}" Size="{Binding Path=Size, RelativeSource={RelativeSource TemplatedParent}}" SizeDefinition="{Binding Path=SizeDefinition, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource InRibbonGalleryToggleButtonStyle}" HorizontalAlignment="Left" VerticalAlignment="Top" ClickMode="Press" CanAddToQuickAccessToolBar="False" />
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="HasFilter" Value="False">
              <Setter Property="Visibility" TargetName="border_" Value="Collapsed" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
              <Setter Property="IsEnabled" TargetName="PART_DropDownButton" Value="False" />
              <Setter Property="IsEnabled" TargetName="PART_ExpandButton" Value="False" />
            </Trigger>
            <Trigger Property="IsCollapsed" Value="True">
              <Setter Property="Visibility" TargetName="border" Value="Collapsed" />
              <Setter Property="Placement" TargetName="PART_Popup" Value="Bottom" />
              <Setter Property="Visibility" TargetName="PART_DropDownButton" Value="Visible" />
              <Setter Property="VerticalAlignment" TargetName="PART_LayoutRoot" Value="Top" />
              <Setter Property="HorizontalAlignment" TargetName="PART_LayoutRoot" Value="Left" />
            </Trigger>
            <Trigger Property="IsDropDownOpen" Value="True">
              <!--<Setter Property="Content" TargetName="contentPresenter" Value="{x:Null}"/>
              <Setter Property="Content" TargetName="popupContentPresenter" Value="{Binding ElementName=PART_GalleryPanel}"/>                            
              <Setter Property="IsGrouped" TargetName="PART_GalleryPanel" Value="True"/>              -->
              <!--<Setter Property="IsHitTestVisible" TargetName="PART_DropDownButton" Value="False"/>-->
            </Trigger>
            <Trigger Property="ResizeMode" Value="None">
              <Setter Property="Visibility" TargetName="resizeBorder" Value="Collapsed" />
            </Trigger>
            <Trigger Property="ResizeMode" Value="Both">
              <Setter Property="Visibility" TargetName="PART_ResizeVerticalThumb" Value="Collapsed" />
              <Setter Property="Visibility" TargetName="PART_ResizeBothThumb" Value="Visible" />
              <Setter Property="Visibility" TargetName="resizeBorder" Value="Visible" />
            </Trigger>
            <Trigger Property="ResizeMode" Value="Vertical">
              <Setter Property="Visibility" TargetName="PART_ResizeBothThumb" Value="Collapsed" />
              <Setter Property="Visibility" TargetName="PART_ResizeVerticalThumb" Value="Visible" />
              <Setter Property="Visibility" TargetName="resizeBorder" Value="Visible" />
            </Trigger>
            <Trigger Property="Menu" Value="{x:Null}">
              <Setter Property="BorderThickness" TargetName="PART_ScrollViewer" Value="0" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="Margin" Value="2,3,3,0" />
  </Style>
  <Style TargetType="{x:Type Fluent:Button}" x:Key="ButtonBackstageStyle">
    <Setter Property="Template" Value="{StaticResource ButtonBackstageControlTemplate}" />
    <Setter Property="Height" Value="81" />
    <Setter Property="Width" Value="85" />
  </Style>
  <Style TargetType="{x:Type Fluent:ToggleButton}" x:Key="ToggleButtonBackstageStyle">
    <Setter Property="Template" Value="{StaticResource ToggleButtonBackstageControlTemplate}" />
    <Setter Property="Height" Value="81" />
    <Setter Property="Width" Value="85" />
  </Style>
  <Style TargetType="{x:Type Fluent:DropDownButton}" x:Key="DropDownButtonBackstageStyle">
    <Setter Property="Template" Value="{StaticResource DropDownButtonBackstageControlTemplate}" />
    <Setter Property="Height" Value="81" />
    <Setter Property="Width" Value="85" />
  </Style>
  <ControlTemplate x:Key="ComboBoxBackstageControlTemplate" TargetType="{x:Type Fluent:ComboBox}">
    <ControlTemplate.Resources>
      <Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}" BasedOn="{StaticResource ScrollBarWhite}" />
      <Style x:Key="{x:Type Fluent:ToggleButton}" TargetType="{x:Type Fluent:ToggleButton}" BasedOn="{StaticResource ToggleButtonBackstageStyle}" />
      <Style x:Key="{x:Type ScrollViewer}" TargetType="{x:Type ScrollViewer}" BasedOn="{StaticResource ScrollViewerStyle}" />
      <Style BasedOn="{StaticResource ComboBoxItemBackstageStyle}" TargetType="{x:Type ComboBoxItem}" />
    </ControlTemplate.Resources>
    <Grid>
      <Rectangle x:Name="rectangle" Fill="{x:Null}" Stroke="{StaticResource ButtonBackstageShadowBrush}" Height="2" VerticalAlignment="Bottom" RadiusX="2" RadiusY="2" Margin="3,0" />
      <Border Height="Auto" x:Name="PART_ContentBorder" HorizontalAlignment="Stretch">
        <Grid>
          <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="22" />
          </Grid.ColumnDefinitions>
          <Fluent:ToggleButton Size="Small" Width="{Binding ElementName=PART_ContentBorder, Path=ActualWidth}" IsDefinitive="False" x:Name="ToggleButton" Focusable="false" IsChecked="{Binding Path=IsDropDownOpen,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}" ClickMode="Press" Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="0" Grid.ColumnSpan="2" Margin="0" CanAddToQuickAccessToolBar="False" />
          <ContentPresenter Margin="3" x:Name="PART_ContentSite" IsHitTestVisible="False" Content="{TemplateBinding SelectionBoxItem}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" VerticalAlignment="Top" HorizontalAlignment="Left" />
          <Image Margin="0" Stretch="None" x:Name="PART_SelectedImage" IsHitTestVisible="False" VerticalAlignment="Top" HorizontalAlignment="Left" Visibility="Collapsed" Width="Auto" Height="Auto" />
          <TextBox Focusable="True" x:Name="PART_EditableTextBox" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" TextWrapping="NoWrap" BorderThickness="0,0,0,0" IsReadOnly="{TemplateBinding IsReadOnly}" Background="{StaticResource TextBoxBackgroundBrush}" Visibility="Collapsed" />
          <Path x:Name="path" HorizontalAlignment="Center" Margin="0,0,0,0" Stretch="Fill" Stroke="{x:Null}" StrokeThickness="0" Data="M0,0L1,1 2,0z" Fill="#FF000000" Width="7" Height="4" VerticalAlignment="Center" Grid.Column="1" />
        </Grid>
      </Border>
      <Popup x:Name="PART_Popup" Placement="Bottom" PlacementTarget="{Binding ElementName=PART_ContentBorder}" IsOpen="{TemplateBinding IsDropDownOpen}" AllowsTransparency="True" Focusable="False" PopupAnimation="Fade" Margin="0,0,-4,0" VerticalAlignment="Top" Grid.ColumnSpan="2">
        <Popup.Resources>
          <ResourceDictionary>
            <Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}" BasedOn="{StaticResource ScrollBarWhite}" />
          </ResourceDictionary>
        </Popup.Resources>
        <Grid Name="DropDown" SnapsToDevicePixels="True" Margin="0" VerticalAlignment="Top">
          <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="10" />
          </Grid.RowDefinitions>
          <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="10" />
          </Grid.ColumnDefinitions>
          <Rectangle HorizontalAlignment="Left" VerticalAlignment="Top" Width="4" Height="4" Grid.Row="1" Grid.Column="1" StrokeThickness="0" Margin="-1,-1,0,0">
            <Rectangle.Fill>
              <RadialGradientBrush RadiusX="0.984" Center="0.017,0.002" GradientOrigin="0.017,0.002" RadiusY="1">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="-1,3,0,0" VerticalAlignment="Top" Width="4" Height="4" Grid.Column="1" Grid.Row="0">
            <Rectangle.Fill>
              <RadialGradientBrush Center="0.032,1.01" GradientOrigin="0.032,1.01" RadiusX="0.984" RadiusY="1">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="3,-1,0,0" VerticalAlignment="Top" Width="4" Height="4" Grid.Column="0" Grid.Row="1">
            <Rectangle.Fill>
              <RadialGradientBrush Center="0.996,0.027" GradientOrigin="0.996,0.027" RadiusX="0.984" RadiusY="1">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Stretch" Margin="7,-1,1,0" VerticalAlignment="Top" Width="Auto" Height="4" Grid.Column="0" Grid.Row="1">
            <Rectangle.Fill>
              <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" MappingMode="RelativeToBoundingBox">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </LinearGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="-1,7,0,1" VerticalAlignment="Stretch" Width="4" Height="Auto" Grid.Column="1" Grid.Row="0">
            <Rectangle.Fill>
              <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5" MappingMode="RelativeToBoundingBox">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </LinearGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Border x:Name="PART_DropDownBorder" MinWidth="{Binding ActualWidth, ElementName=PART_ContentBorder}" SnapsToDevicePixels="True" Background="{StaticResource ContextMenuBarBackgroundBrush}" BorderBrush="{StaticResource ContextMenuBarBorderBrush}" BorderThickness="1" CornerRadius="1" Grid.ColumnSpan="1" HorizontalAlignment="Stretch" VerticalAlignment="Top">
            <Grid Width="Auto" Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Top" KeyboardNavigation.DirectionalNavigation="Cycle">
              <Border VerticalAlignment="Stretch" Width="Auto" Height="Auto" BorderBrush="{StaticResource ContextMenuBarBackgroundBrush}" BorderThickness="1" CornerRadius="1" />
              <Grid Margin="1" HorizontalAlignment="Stretch" VerticalAlignment="Top">
                <Grid.RowDefinitions>
                  <RowDefinition Height="*" />
                  <RowDefinition Height="Auto" />
                  <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Rectangle Fill="{x:Null}" Stretch="Fill" Stroke="#FFE2E4E7" HorizontalAlignment="Left" Margin="24,0,0,0" Width="1" Height="Auto" Grid.RowSpan="2" Visibility="Visible" VerticalAlignment="Stretch" />
                <Grid x:Name="PART_MenuPanel" MaxHeight="{TemplateBinding MaxDropDownHeight}" VerticalAlignment="Top">
                  <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                    <RowDefinition Height="Auto" />
                  </Grid.RowDefinitions>
                  <ScrollViewer Grid.Row="0" Focusable="False" BorderBrush="{StaticResource GalleryBorderBrush}" x:Name="PART_ScrollViewer" Margin="1" SnapsToDevicePixels="True" KeyboardNavigation.DirectionalNavigation="None" VerticalAlignment="Stretch" VerticalScrollBarVisibility="Visible" BorderThickness="0,0,0,1">
                    <Fluent:GalleryPanel Background="White" x:Name="PART_GalleryPanel" ItemContainerGenerator="{Binding ItemContainerGenerator, RelativeSource={RelativeSource TemplatedParent}}" GroupBy="{TemplateBinding GroupBy}" IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="None" ItemHeight="{TemplateBinding ItemHeight}" Orientation="Vertical" />
                    <!--<StackPanel Background="White" IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="None" Orientation="Vertical"/>-->
                  </ScrollViewer>
                  <ContentPresenter Grid.Row="1" x:Name="menuPresenter" ContentSource="Menu" KeyboardNavigation.DirectionalNavigation="None" VerticalAlignment="Top" />
                </Grid>
                <Border x:Name="resizeBorder" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="11" BorderBrush="{StaticResource ContextMenuBarResizeBorderBrush}" BorderThickness="0,1,0,0" Grid.Row="2" CornerRadius="0,0,1,1" Background="{StaticResource ContextMenuBarResizeBackgoundBrush}">
                  <Grid>
                    <Thumb x:Name="PART_ResizeVerticalThumb" HorizontalAlignment="Stretch" Margin="0,0,0,-90" Width="Auto" Height="10" VerticalAlignment="Top" Cursor="SizeNS" Template="{StaticResource ResizeVerticalThumbControlTemplate}" />
                    <Thumb x:Name="PART_ResizeBothThumb" HorizontalAlignment="Right" Margin="0,0,0,-90" Width="10" Height="10" VerticalAlignment="Top" Cursor="SizeNWSE" Template="{StaticResource ResizeBothThumbControlTemplate}" />
                  </Grid>
                </Border>
              </Grid>
            </Grid>
          </Border>
        </Grid>
      </Popup>
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="ResizeMode" Value="None">
        <Setter Property="Visibility" TargetName="resizeBorder" Value="Collapsed" />
      </Trigger>
      <Trigger Property="ResizeMode" Value="Both">
        <Setter Property="Visibility" TargetName="PART_ResizeVerticalThumb" Value="Collapsed" />
        <Setter Property="Visibility" TargetName="PART_ResizeBothThumb" Value="Visible" />
        <Setter Property="Visibility" TargetName="resizeBorder" Value="Visible" />
      </Trigger>
      <Trigger Property="ResizeMode" Value="Vertical">
        <Setter Property="Visibility" TargetName="PART_ResizeBothThumb" Value="Collapsed" />
        <Setter Property="Visibility" TargetName="PART_ResizeVerticalThumb" Value="Visible" />
        <Setter Property="Visibility" TargetName="resizeBorder" Value="Visible" />
      </Trigger>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="BorderBrush" TargetName="PART_ContentBorder" Value="#FFC8C8C9" />
        <Setter Property="Opacity" TargetName="rectangle" Value="0" />
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <Style x:Key="RibbonToolBarControlGroupStyle" TargetType="{x:Type Fluent:RibbonToolBarControlGroup}">
    <Setter Property="Template" Value="{StaticResource RibbonToolBarControlGroupTemplate}" />
    <Setter Property="Focusable" Value="False" />
  </Style>
  <Style x:Key="RibbonComboButtonStyle" TargetType="{x:Type Fluent:ToggleButton}">
    <Setter Property="Template" Value="{StaticResource RibbonComboButtonControlTemplate}" />
    <Setter Property="Height" Value="68" />
    <Setter Property="Width" Value="Auto" />
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
    <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}" />
    <Setter Property="Foreground" Value="{StaticResource DefaultFontBrush}" />
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlStyleEmptyFocus}" />
  </Style>
  <Style TargetType="{x:Type Fluent:ComboBox}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Fluent:ComboBox}">
          <ControlTemplate.Resources>
            <ResourceDictionary>
              <Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}" BasedOn="{StaticResource ScrollBarWhite}" />
              <Style x:Key="{x:Type ScrollViewer}" TargetType="{x:Type ScrollViewer}" BasedOn="{StaticResource ScrollViewerStyle}" />
            </ResourceDictionary>
          </ControlTemplate.Resources>
          <Border Width="Auto" Background="#00000000" Height="22">
            <Grid Width="Auto" Height="Auto" Background="#00000000">
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition />
              </Grid.ColumnDefinitions>
              <StackPanel Orientation="Horizontal" Grid.ColumnSpan="1" x:Name="stackPanel" HorizontalAlignment="Stretch" Margin="0,0,4,0">
                <ContentPresenter x:Name="iconImage" Width="16" Height="16" VerticalAlignment="Center" Margin="3,0,0,0" Content="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource StringToImageConvert}}" />
                <TextBlock Text="{TemplateBinding Header}" TextWrapping="Wrap" VerticalAlignment="Center" Margin="5,0,0,0" x:Name="textBlock" />
              </StackPanel>
              <Border Height="Auto" BorderThickness="1,1,1,1" BorderBrush="{StaticResource TextBoxBorderBrush}" x:Name="PART_ContentBorder" Background="{StaticResource TextBoxBackgroundBrush}" Grid.Column="1" Grid.ColumnSpan="1" Width="{TemplateBinding InputWidth}" d:LayoutOverrides="GridBox" HorizontalAlignment="Right">
                <Grid>
                  <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="13" />
                  </Grid.ColumnDefinitions>
                  <Border Grid.ColumnSpan="1" Grid.Column="1" BorderThickness="1,0,0,0" BorderBrush="{StaticResource TextBoxHoverBorderBrush}" Visibility="Collapsed" x:Name="border1" Background="{StaticResource TextBoxBackgroundBrush}" />
                  <Fluent:ToggleButton IsDefinitive="False" x:Name="ToggleButton" Focusable="false" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" ClickMode="Press" Height="Auto" VerticalAlignment="Stretch" Grid.ColumnSpan="2" Margin="0,-1,-1,-1" Style="{StaticResource RibbonComboButtonStyle}" CanAddToQuickAccessToolBar="False" />
                  <ContentPresenter Margin="3" x:Name="PART_ContentSite" IsHitTestVisible="False" Content="{TemplateBinding SelectionBoxItem}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" VerticalAlignment="Top" HorizontalAlignment="Left" />
                  <Image Margin="0" Stretch="None" x:Name="PART_SelectedImage" IsHitTestVisible="False" VerticalAlignment="Top" HorizontalAlignment="Left" Visibility="Collapsed" Width="Auto" Height="Auto" />
                  <TextBox Focusable="True" x:Name="PART_EditableTextBox" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" TextWrapping="NoWrap" BorderThickness="0,0,0,0" IsReadOnly="{TemplateBinding IsReadOnly}" Background="{StaticResource TextBoxBackgroundBrush}" Visibility="Hidden" />
                </Grid>
              </Border>
              <Popup x:Name="PART_Popup" Placement="Bottom" PlacementTarget="{Binding ElementName=PART_ContentBorder}" IsOpen="{TemplateBinding IsDropDownOpen}" AllowsTransparency="True" Focusable="False" PopupAnimation="Fade" Margin="0,0,-4,0" VerticalAlignment="Top" Grid.ColumnSpan="2">
                <Popup.Resources>
                  <ResourceDictionary>
                    <Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}" BasedOn="{StaticResource ScrollBarWhite}" />
                  </ResourceDictionary>
                </Popup.Resources>
                <Grid Name="DropDown" SnapsToDevicePixels="True" Margin="0" VerticalAlignment="Top">
                  <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                    <RowDefinition Height="4" />
                  </Grid.RowDefinitions>
                  <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="4" />
                  </Grid.ColumnDefinitions>
                  <Rectangle HorizontalAlignment="Left" VerticalAlignment="Top" Width="4" Height="4" Grid.Row="1" Grid.Column="1" StrokeThickness="0" Margin="-1,-1,0,0">
                    <Rectangle.Fill>
                      <RadialGradientBrush RadiusX="0.984" Center="0.017,0.002" GradientOrigin="0.017,0.002" RadiusY="1">
                        <GradientStop Color="#3F000000" Offset="0" />
                        <GradientStop Color="#00000000" Offset="1" />
                      </RadialGradientBrush>
                    </Rectangle.Fill>
                  </Rectangle>
                  <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="-1,3,0,0" VerticalAlignment="Top" Width="4" Height="4" Grid.Column="1" Grid.Row="0">
                    <Rectangle.Fill>
                      <RadialGradientBrush Center="0.032,1.01" GradientOrigin="0.032,1.01" RadiusX="0.984" RadiusY="1">
                        <GradientStop Color="#3F000000" Offset="0" />
                        <GradientStop Color="#00000000" Offset="1" />
                      </RadialGradientBrush>
                    </Rectangle.Fill>
                  </Rectangle>
                  <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="3,-1,0,0" VerticalAlignment="Top" Width="4" Height="4" Grid.Column="0" Grid.Row="1">
                    <Rectangle.Fill>
                      <RadialGradientBrush Center="0.996,0.027" GradientOrigin="0.996,0.027" RadiusX="0.984" RadiusY="1">
                        <GradientStop Color="#3F000000" Offset="0" />
                        <GradientStop Color="#00000000" Offset="1" />
                      </RadialGradientBrush>
                    </Rectangle.Fill>
                  </Rectangle>
                  <Rectangle StrokeThickness="0" HorizontalAlignment="Stretch" Margin="7,-1,1,0" VerticalAlignment="Top" Width="Auto" Height="4" Grid.Column="0" Grid.Row="1">
                    <Rectangle.Fill>
                      <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" MappingMode="RelativeToBoundingBox">
                        <GradientStop Color="#3F000000" Offset="0" />
                        <GradientStop Color="#00000000" Offset="1" />
                      </LinearGradientBrush>
                    </Rectangle.Fill>
                  </Rectangle>
                  <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="-1,7,0,1" VerticalAlignment="Stretch" Width="4" Height="Auto" Grid.Column="1" Grid.Row="0">
                    <Rectangle.Fill>
                      <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5" MappingMode="RelativeToBoundingBox">
                        <GradientStop Color="#3F000000" Offset="0" />
                        <GradientStop Color="#00000000" Offset="1" />
                      </LinearGradientBrush>
                    </Rectangle.Fill>
                  </Rectangle>
                  <Border x:Name="PART_DropDownBorder" Margin="0" MinWidth="{Binding ActualWidth, ElementName=PART_ContentBorder}" SnapsToDevicePixels="True" Background="{StaticResource ContextMenuBarBackgroundBrush}" BorderBrush="{StaticResource ContextMenuBarBorderBrush}" BorderThickness="1" CornerRadius="1" Grid.ColumnSpan="1" d:LayoutOverrides="Width, Height" HorizontalAlignment="Stretch" VerticalAlignment="Top">
                    <Grid Width="Auto" Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Top" KeyboardNavigation.DirectionalNavigation="Cycle">
                      <Border VerticalAlignment="Stretch" Width="Auto" Height="Auto" BorderBrush="{StaticResource ContextMenuBarBackgroundBrush}" BorderThickness="1" CornerRadius="1" />
                      <Grid Margin="1" HorizontalAlignment="Stretch" VerticalAlignment="Top">
                        <Grid.RowDefinitions>
                          <RowDefinition Height="Auto" />
                          <RowDefinition Height="*" />
                          <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <Rectangle Fill="{x:Null}" Stretch="Fill" Stroke="#FFE2E4E7" HorizontalAlignment="Left" Margin="24,0,0,0" Width="1" Height="Auto" Grid.RowSpan="3" Visibility="Visible" VerticalAlignment="Stretch" />
                        <ContentControl x:Name="upResizeContent" />
                        <Grid Grid.Row="1" x:Name="PART_MenuPanel" MaxHeight="{TemplateBinding MaxDropDownHeight}" VerticalAlignment="Top">
                          <Grid.RowDefinitions>
                            <RowDefinition Height="*" />
                            <RowDefinition Height="Auto" />
                          </Grid.RowDefinitions>
                          <ScrollViewer Focusable="False" BorderBrush="{StaticResource GalleryBorderBrush}" x:Name="PART_ScrollViewer" Margin="1" SnapsToDevicePixels="True" KeyboardNavigation.DirectionalNavigation="None" VerticalAlignment="Stretch" BorderThickness="0,0,0,1">
                            <Fluent:GalleryPanel x:Name="PART_GalleryPanel" Background="White" ItemContainerGenerator="{Binding ItemContainerGenerator, RelativeSource={RelativeSource TemplatedParent}}" GroupBy="{TemplateBinding GroupBy}" IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="None" ItemHeight="{TemplateBinding ItemHeight}" Orientation="Vertical" />
                            <!--<StackPanel Background="White" IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="None" Orientation="Vertical"/>-->
                          </ScrollViewer>
                          <ContentPresenter x:Name="menuPresenter" ContentSource="Menu" Grid.Row="1" KeyboardNavigation.DirectionalNavigation="None" VerticalAlignment="Top" />
                        </Grid>
                        <ContentControl x:Name="downResizeContent" Grid.Row="2">
                          <Border RenderTransformOrigin="0.5, 0.5" x:Name="resizeBorder" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="11" BorderBrush="{StaticResource ContextMenuBarResizeBorderBrush}" BorderThickness="0,1,0,0" CornerRadius="0,0,1,1" Background="{StaticResource ContextMenuBarResizeBackgoundBrush}">
                            <Grid>
                              <Thumb x:Name="PART_ResizeVerticalThumb" HorizontalAlignment="Stretch" Margin="0,0,0,-90" Width="Auto" Height="10" VerticalAlignment="Top" Cursor="SizeNS" Template="{StaticResource ResizeVerticalThumbControlTemplate}" />
                              <Thumb x:Name="PART_ResizeBothThumb" HorizontalAlignment="Right" Margin="0,0,0,-90" Width="10" Height="10" VerticalAlignment="Top" Cursor="SizeNWSE" Template="{StaticResource ResizeBothThumbControlTemplate}" />
                            </Grid>
                          </Border>
                        </ContentControl>
                      </Grid>
                    </Grid>
                  </Border>
                </Grid>
              </Popup>
            </Grid>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="ShowPopupOnTop" Value="True">
              <Setter Property="Content" TargetName="downResizeContent" Value="{x:Null}" />
              <Setter Property="Content" TargetName="upResizeContent" Value="{Binding ElementName=resizeBorder}" />
              <Setter Property="CornerRadius" TargetName="resizeBorder" Value="1,1,0,0" />
              <Setter Property="Cursor" TargetName="PART_ResizeBothThumb" Value="SizeNESW" />
              <Setter Property="LayoutTransform" TargetName="PART_ResizeBothThumb">
                <Setter.Value>
                  <ScaleTransform ScaleX="1" ScaleY="-1" />
                </Setter.Value>
              </Setter>
              <Setter Property="LayoutTransform" TargetName="PART_ResizeVerticalThumb">
                <Setter.Value>
                  <ScaleTransform ScaleX="1" ScaleY="-1" />
                </Setter.Value>
              </Setter>
            </Trigger>
            <Trigger Property="Menu" Value="{x:Null}">
              <Setter Property="BorderThickness" TargetName="PART_ScrollViewer" Value="0" />
            </Trigger>
            <Trigger Property="ResizeMode" Value="None">
              <Setter Property="Visibility" TargetName="resizeBorder" Value="Collapsed" />
            </Trigger>
            <Trigger Property="ResizeMode" Value="Both">
              <Setter Property="Visibility" TargetName="PART_ResizeVerticalThumb" Value="Collapsed" />
              <Setter Property="Visibility" TargetName="PART_ResizeBothThumb" Value="Visible" />
              <Setter Property="Visibility" TargetName="resizeBorder" Value="Visible" />
            </Trigger>
            <Trigger Property="ResizeMode" Value="Vertical">
              <Setter Property="Visibility" TargetName="PART_ResizeBothThumb" Value="Collapsed" />
              <Setter Property="Visibility" TargetName="PART_ResizeVerticalThumb" Value="Visible" />
              <Setter Property="Visibility" TargetName="resizeBorder" Value="Visible" />
            </Trigger>
            <Trigger Property="Icon" Value="{x:Null}">
              <Setter Property="Visibility" TargetName="iconImage" Value="Collapsed" />
            </Trigger>
            <Trigger Property="InputWidth" Value="NaN">
              <Setter Property="HorizontalAlignment" TargetName="PART_ContentBorder" Value="Stretch" />
            </Trigger>
            <Trigger Property="Size" Value="Middle">
              <Setter Property="Visibility" TargetName="textBlock" Value="Collapsed" />
            </Trigger>
            <Trigger Property="Size" Value="Small">
              <Setter Property="Visibility" TargetName="stackPanel" Value="Collapsed" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
              <Setter Property="IsEnabled" TargetName="PART_EditableTextBox" Value="False" />
              <Setter Property="Background" TargetName="PART_ContentBorder" Value="{StaticResource TextBoxDisabledBackgroundBrush}" />
              <Setter Property="BorderBrush" TargetName="PART_ContentBorder" Value="{StaticResource TextBoxDisabledBorderBrush}" />
              <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource TextBoxDisabledBackgroundBrush}" />
              <Setter Property="BorderBrush" TargetName="PART_EditableTextBox" Value="{StaticResource TextBoxDisabledBackgroundBrush}" />
              <Setter Property="Opacity" TargetName="iconImage" Value="0.5" />
              <Setter Property="Opacity" TargetName="textBlock" Value="0.5" />
              <Setter Property="Effect" TargetName="iconImage">
                <Setter.Value>
                  <Fluent:GrayscaleEffect />
                </Setter.Value>
              </Setter>
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True">
              <Setter Property="Visibility" TargetName="border1" Value="Visible" />
              <Setter Property="BorderBrush" TargetName="PART_ContentBorder" Value="{StaticResource TextBoxHoverBorderBrush}" />
              <Setter Property="Background" TargetName="PART_EditableTextBox" Value="{StaticResource TextBoxHoverBackgroundBrush}" />
              <Setter Property="Background" TargetName="border1" Value="{StaticResource TextBoxHoverBackgroundBrush}" />
              <Setter Property="Background" TargetName="PART_ContentBorder" Value="{StaticResource TextBoxHoverBackgroundBrush}" />
            </Trigger>
            <Trigger Property="IsKeyboardFocusWithin" Value="True">
              <Setter Property="Visibility" TargetName="border1" Value="Visible" />
              <Setter Property="BorderBrush" TargetName="PART_ContentBorder" Value="{StaticResource TextBoxHoverBorderBrush}" />
              <Setter Property="Background" TargetName="PART_EditableTextBox" Value="{StaticResource TextBoxHoverBackgroundBrush}" />
              <Setter Property="Background" TargetName="border1" Value="{StaticResource TextBoxHoverBackgroundBrush}" />
              <Setter Property="Background" TargetName="PART_ContentBorder" Value="{StaticResource TextBoxHoverBackgroundBrush}" />
            </Trigger>
            <Trigger Property="HasItems" Value="false">
              <Setter TargetName="PART_DropDownBorder" Property="MinHeight" Value="95" />
            </Trigger>
            <Trigger Property="IsGrouping" Value="true">
              <Setter Property="ScrollViewer.CanContentScroll" Value="false" />
            </Trigger>
            <Trigger Property="IsEditable" Value="true">
              <Setter Property="IsTabStop" Value="false" />
              <Setter TargetName="PART_EditableTextBox" Property="Visibility" Value="Visible" />
              <Setter TargetName="PART_ContentSite" Property="Visibility" Value="Hidden" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Visible" />
    <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
    <Setter Property="MaxDropDownHeight" Value="{x:Static System:Double.PositiveInfinity}" />
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlStyleEmptyFocus}" />
    <Setter Property="IsEditable" Value="True" />
    <!--<Setter Property="ItemContainerStyle" Value="{DynamicResource EditableComboBoxItemStyle}"/>-->
    <Style.Triggers>
      <!--<Trigger Property="IsEditable" Value="False">
        <Setter Property="ItemContainerStyle" Value="{DynamicResource NonEditableComboBoxItemStyle}"/>
      </Trigger>-->
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="ItemContainerStyleSelector" Value="{x:Null}" />
          <Condition Property="IsEditable" Value="True" />
        </MultiTrigger.Conditions>
        <Setter Property="ItemContainerStyle" Value="{StaticResource EditableComboBoxItemStyle}" />
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="ItemContainerStyleSelector" Value="{x:Null}" />
          <Condition Property="IsEditable" Value="False" />
        </MultiTrigger.Conditions>
        <Setter Property="ItemContainerStyle" Value="{StaticResource NonEditableComboBoxItemStyle}" />
      </MultiTrigger>
    </Style.Triggers>
  </Style>
  <Style TargetType="{x:Type Fluent:StatusBarMenuItem}">
    <Setter Property="Template" Value="{StaticResource RibbonStatusBarContextMenuItemControlTemplate}" />
    <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}" />
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
    <Setter Property="Foreground" Value="{StaticResource DefaultFontBrush}" />
    <Setter Property="IsCheckable" Value="True" />
    <Setter Property="IsChecked" Value="{Binding StatusBarItem.IsChecked, RelativeSource={RelativeSource Self}, Mode=TwoWay}" />
  </Style>
  <Style x:Key="SliderRepeatButtonStyle" TargetType="{x:Type RepeatButton}">
    <Setter Property="Width" Value="16" />
    <Setter Property="Height" Value="16" />
    <Setter Property="Template" Value="{StaticResource SliderRepeatButtonControlTemplate}" />
  </Style>
  <Style x:Key="ZoomSliderStyle" TargetType="{x:Type Slider}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Slider}">
          <Grid Height="16" Width="133">
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="16" />
              <ColumnDefinition Width="*" />
              <ColumnDefinition Width="16" />
            </Grid.ColumnDefinitions>
            <Rectangle Grid.ColumnSpan="1" Fill="{x:Null}" Margin="0,-1,0,0" Stroke="{StaticResource SliderShadowBrush}" VerticalAlignment="Center" Height="1" Grid.Column="1" />
            <Rectangle Grid.ColumnSpan="1" Fill="{x:Null}" Margin="-1,-1,0,0" Stroke="{StaticResource SliderShadowBrush}" VerticalAlignment="Center" Height="7" Grid.Column="1" Width="1" HorizontalAlignment="Center" />
            <Rectangle Grid.ColumnSpan="1" Fill="{x:Null}" Margin="0,1,0,0" Stroke="{StaticResource SliderLightenBrush}" VerticalAlignment="Center" Height="1" Grid.Column="1" />
            <Rectangle Grid.ColumnSpan="1" Fill="{x:Null}" Margin="1,1,0,0" Stroke="{StaticResource SliderLightenBrush}" VerticalAlignment="Center" Height="7" Grid.Column="1" Width="1" HorizontalAlignment="Center" />
            <Rectangle x:Name="rectangle" Grid.ColumnSpan="1" Margin="0" Stroke="{x:Null}" Grid.Column="1" StrokeThickness="0" Fill="#00000000" />
            <Track Grid.Row="0" x:Name="PART_Track" Height="16" Grid.ColumnSpan="1" Grid.Column="1">
              <Track.DecreaseRepeatButton>
                <RepeatButton Style="{StaticResource SliderButtonStyle}" Command="Slider.DecreaseLarge" x:Name="leftButton" />
              </Track.DecreaseRepeatButton>
              <Track.Thumb>
                <Thumb x:Name="thumb" Style="{StaticResource SliderThumbStyle}" />
              </Track.Thumb>
              <Track.IncreaseRepeatButton>
                <RepeatButton Style="{StaticResource SliderButtonStyle}" Command="Slider.IncreaseLarge" x:Name="rightButton" />
              </Track.IncreaseRepeatButton>
            </Track>
            <RepeatButton x:Name="repeatButton" d:LayoutOverrides="Width, Height" Style="{StaticResource SliderRepeatButtonStyle}" Command="Slider.DecreaseLarge">
              <Grid Margin="0">
                <Path Data="M0,0L1,0" Fill="{x:Null}" HorizontalAlignment="Center" Margin="0" Stretch="Fill" Width="10" VerticalAlignment="Center" Height="2" StrokeThickness="2" Stroke="{ DynamicResource RoundButtonForegroundBrush}" />
              </Grid>
            </RepeatButton>
            <RepeatButton x:Name="repeatButton_Copy" Style="{StaticResource SliderRepeatButtonStyle}" Grid.Column="2" Command="Slider.IncreaseLarge">
              <Grid Margin="0">
                <Path Data="M0,0L0,1" HorizontalAlignment="Center" Margin="0" Stretch="Fill" Width="2" VerticalAlignment="Center" Height="10" StrokeThickness="2" Stroke="{ DynamicResource RoundButtonForegroundBrush}" />
                <Path Data="M0,0L1,0" HorizontalAlignment="Center" Margin="0" Stretch="Fill" Width="10" VerticalAlignment="Center" Height="2" StrokeThickness="2" Stroke="{ DynamicResource RoundButtonForegroundBrush}" />
              </Grid>
            </RepeatButton>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="True" SourceName="leftButton">
              <Setter Property="Background" TargetName="thumb" Value="Red" />
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True" SourceName="rightButton">
              <Setter Property="Background" TargetName="thumb" Value="Red" />
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True" SourceName="thumb">
              <Setter Property="Background" TargetName="thumb" Value="Red" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="Width" Value="133" />
    <Setter Property="Height" Value="16" />
    <Setter Property="Maximum" Value="500" />
    <Setter Property="Minimum" Value="10" />
    <Setter Property="SmallChange" Value="1" />
    <Setter Property="LargeChange" Value="10" />
    <Setter Property="Value" Value="100" />
  </Style>
  <Style x:Key="CaptionButtonStyle" TargetType="{x:Type Button}">
    <Setter Property="Width" Value="35" />
    <Setter Property="Height" Value="19" />
    <Setter Property="Template" Value="{StaticResource CaptionButtonControlTemplate}" />
    <Setter Property="Focusable" Value="False" />
  </Style>
  <Style x:Key="{x:Type Fluent:ToggleButton}" TargetType="{x:Type Fluent:ToggleButton}" BasedOn="{StaticResource RibbonToggleButtonStyle}" />
  <Style x:Key="{x:Type Fluent:Gallery}" TargetType="{x:Type Fluent:Gallery}" BasedOn="{StaticResource GalleryStyle}" />
  <Style x:Key="{x:Type Fluent:RibbonContextualTabGroup}" TargetType="{x:Type Fluent:RibbonContextualTabGroup}" BasedOn="{StaticResource RibbonContextualTabGroupStyle}" />
  <Style x:Key="{x:Type Fluent:RibbonToolBarControlGroup}" TargetType="{x:Type Fluent:RibbonToolBarControlGroup}" BasedOn="{StaticResource RibbonToolBarControlGroupStyle}" />
  <Style x:Key="RibbonGroupBoxQuickAccessStyle" TargetType="{x:Type Fluent:RibbonGroupBox}">
    <Setter Property="Template" Value="{StaticResource RibbonGroupBoxDropDownButtonControlTemplate}" />
    <Setter Property="Height" Value="22" />
    <Setter Property="Width" Value="22" />
    <Setter Property="Focusable" Value="False" />
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
    <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}" />
    <Setter Property="Foreground" Value="{StaticResource DefaultFontBrush}" />
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlStyleEmptyFocus}" />
    <Setter Property="SnapsToDevicePixels" Value="False" />
  </Style>
  <ControlTemplate x:Key="RibbonGroupBoxControlTemplate" TargetType="{x:Type Fluent:RibbonGroupBox}">
    <ControlTemplate.Resources>
      <ResourceDictionary>
        <Storyboard x:Key="OnMouseEnter1">
          <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="hoverGrid" Storyboard.TargetProperty="(UIElement.Opacity)">
            <SplineDoubleKeyFrame KeyTime="00:00:01" Value="1" />
          </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Key="OnMouseLeave1">
          <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="hoverGrid" Storyboard.TargetProperty="(UIElement.Opacity)">
            <SplineDoubleKeyFrame KeyTime="00:00:01" Value="0" />
          </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Style TargetType="Separator" BasedOn="{StaticResource GroupBoxSeparator}" />
        <Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}" BasedOn="{StaticResource ScrollBarWhite}" />
        <Style x:Key="{x:Type ScrollViewer}" TargetType="{x:Type ScrollViewer}" BasedOn="{StaticResource ScrollViewerStyle}" />
      </ResourceDictionary>
    </ControlTemplate.Resources>
    <Grid x:Name="grid2" HorizontalAlignment="Stretch">
      <Grid Background="#00000000">
        <Grid x:Name="hoverGrid" Background="{StaticResource GroupHoverBrush}" HorizontalAlignment="Stretch" Margin="0,0,1,1" VerticalAlignment="Stretch" Width="Auto" Height="Auto" ClipToBounds="True" Opacity="0" Grid.RowSpan="2">
          <Rectangle Stroke="{x:Null}" StrokeThickness="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Height="Auto" Fill="{StaticResource GroupHighlightBrush}" />
        </Grid>
        <ContentControl x:Name="border1" Focusable="False">
          <Grid x:Name="PART_ParentPanel" Margin="0,1,0,2" Grid.RowSpan="2" Height="85">
            <Grid.RowDefinitions>
              <RowDefinition Height="*" />
              <RowDefinition Height="17" />
            </Grid.RowDefinitions>
            <Grid x:Name="PART_DownGrid" MaxWidth="{Binding ActualWidth, ElementName=PART_UpPanel}" Margin="0,-2,2,2" Grid.Row="1" VerticalAlignment="Bottom" Height="17">
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
              </Grid.ColumnDefinitions>
              <TextBlock HorizontalAlignment="Stretch" VerticalAlignment="Center" Text="{TemplateBinding Header}" TextWrapping="NoWrap" Grid.Row="1" Foreground="{StaticResource GroupBoxFontBrush}" Margin="2,0" TextTrimming="CharacterEllipsis" TextAlignment="Center" />
              <Fluent:Button Margin="0,0,1,1" x:Name="PART_DialogLauncherButton" HorizontalAlignment="Stretch" Width="15" Height="14" Grid.Column="1" Focusable="False" IsTabStop="False" Template="{StaticResource DialogLauncherButtonControlTemplate}" VerticalAlignment="Bottom" Icon="{TemplateBinding LauncherIcon}" Header="{TemplateBinding LauncherText}" Command="{Binding LauncherCommand, RelativeSource={RelativeSource TemplatedParent}}" CommandTarget="{Binding LauncherCommandTarget, RelativeSource={RelativeSource TemplatedParent}}" CommandParameter="{Binding LauncherCommandParameter, RelativeSource={RelativeSource TemplatedParent}}" ToolTip="{Binding LauncherToolTip, RelativeSource={RelativeSource TemplatedParent}}" IsEnabled="{Binding IsLauncherEnabled, RelativeSource={RelativeSource TemplatedParent}}" />
            </Grid>
            <WrapPanel x:Name="PART_UpPanel" HorizontalAlignment="Left" VerticalAlignment="Stretch" Width="Auto" Height="Auto" IsItemsHost="True" Margin="2,0,4,0" Orientation="Vertical" FocusManager.IsFocusScope="False" />
          </Grid>
        </ContentControl>
        <Grid x:Name="grid1" Margin="0" Width="Auto" Height="Auto" Background="#00000000" Visibility="Collapsed" Grid.RowSpan="2">
          <Fluent:TwoLineLabel HorizontalAlignment="Center" VerticalAlignment="Top" Text="{TemplateBinding Header}" Margin="5,38,5,0" HasGlyph="True" HasTwoLines="True" Style="{StaticResource TwoLineLabelStyle}" />
          <Border HorizontalAlignment="Center" VerticalAlignment="Top" Width="31" Height="31" BorderBrush="#FFD0D4D9" BorderThickness="1" Margin="5,3,8,0" CornerRadius="3">
            <ContentPresenter x:Name="iconImage" Height="16" Content="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource StringToImageConvert}}" Width="16" SnapsToDevicePixels="True" />
          </Border>
          <Popup x:Name="PART_Popup" Width="Auto" Height="Auto" AllowsTransparency="True" PlacementTarget="{Binding ElementName=grid1, Mode=OneWay}" StaysOpen="True" IsOpen="{TemplateBinding IsDropDownOpen}">
            <Grid Width="Auto" Height="Auto" Margin="0,20">
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="5" />
              </Grid.ColumnDefinitions>
              <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="5" />
              </Grid.RowDefinitions>
              <Rectangle Stroke="{x:Null}" StrokeThickness="0" HorizontalAlignment="Stretch" Margin="11,-1,1,0" VerticalAlignment="Stretch" Height="Auto" Grid.Column="0" Grid.Row="1" Grid.RowSpan="1">
                <Rectangle.Fill>
                  <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" MappingMode="RelativeToBoundingBox">
                    <GradientStop Color="#7F000000" Offset="0" />
                    <GradientStop Offset="1" />
                  </LinearGradientBrush>
                </Rectangle.Fill>
              </Rectangle>
              <Rectangle Stroke="{x:Null}" StrokeThickness="0" HorizontalAlignment="Stretch" Margin="-1,11,0,1" VerticalAlignment="Stretch" Height="Auto" Grid.Column="1" Grid.Row="0" Grid.RowSpan="1">
                <Rectangle.Fill>
                  <LinearGradientBrush EndPoint="1.002,0" MappingMode="RelativeToBoundingBox">
                    <GradientStop Color="#7F000000" Offset="0" />
                    <GradientStop Offset="1" />
                  </LinearGradientBrush>
                </Rectangle.Fill>
              </Rectangle>
              <Rectangle Stroke="{x:Null}" StrokeThickness="0" HorizontalAlignment="Stretch" Margin="-1,-1,0,0" VerticalAlignment="Stretch" Height="Auto" Grid.Column="1" Grid.Row="1" Grid.RowSpan="1">
                <Rectangle.Fill>
                  <RadialGradientBrush Center="-0.003,0.011" GradientOrigin="-0.003,0.011" RadiusX="1.006" RadiusY="1">
                    <GradientStop Color="#7F000000" Offset="0.002" />
                    <GradientStop Offset="1" />
                  </RadialGradientBrush>
                </Rectangle.Fill>
              </Rectangle>
              <Rectangle Stroke="{x:Null}" StrokeThickness="0" HorizontalAlignment="Stretch" Margin="-1,5,0,0" VerticalAlignment="Top" Height="6" Grid.Column="1" Grid.Row="0" Grid.RowSpan="1">
                <Rectangle.Fill>
                  <RadialGradientBrush Center="-0.01,1.004" GradientOrigin="-0.01,1.004" RadiusX="1.006" RadiusY="1">
                    <GradientStop Color="#7F000000" Offset="0.002" />
                    <GradientStop Offset="1" />
                  </RadialGradientBrush>
                </Rectangle.Fill>
              </Rectangle>
              <Rectangle Stroke="{x:Null}" StrokeThickness="0" HorizontalAlignment="Left" Margin="5,-1,0,0" VerticalAlignment="Stretch" Height="Auto" Grid.Column="0" Grid.Row="1" Grid.RowSpan="1" Width="6">
                <Rectangle.Fill>
                  <RadialGradientBrush Center="1.003,-0.006" GradientOrigin="1.003,-0.006" RadiusX="1.006" RadiusY="1">
                    <GradientStop Color="#7F000000" Offset="0.002" />
                    <GradientStop Offset="1" />
                  </RadialGradientBrush>
                </Rectangle.Fill>
              </Rectangle>
              <Border x:Name="border" Height="Auto" Grid.RowSpan="1" Background="{StaticResource RibbonBackgoundBrush}" BorderBrush="{StaticResource RibbonTopBorderBrush}" BorderThickness="1" CornerRadius="1" d:LayoutOverrides="Width">
                <ContentControl x:Name="popupContent" />
              </Border>
            </Grid>
          </Popup>
        </Grid>
        <Border x:Name="separator" BorderBrush="{StaticResource GroupSeparatorBorderBrush}" Background="{StaticResource GroupSeparatorBackgroundBrush}" HorizontalAlignment="Right" VerticalAlignment="Stretch" Width="3" Height="Auto" Grid.RowSpan="2" BorderThickness="1,0" />
      </Grid>
      <Image x:Name="PART_SnappedImage" Visibility="Collapsed" />
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="State" Value="Collapsed">
        <Setter Property="Visibility" TargetName="grid1" Value="Visible" />
        <Setter Property="UIElement.Visibility" TargetName="border1" Value="Collapsed" />
        <Setter Property="HorizontalAlignment" TargetName="grid2" Value="Left" />
        <Setter Property="Content" TargetName="border1" Value="{x:Null}" />
        <Setter Property="Content" TargetName="popupContent" Value="{Binding ElementName=PART_ParentPanel}" />
      </Trigger>
      <Trigger Property="IsMouseOver" Value="True">
        <Trigger.EnterActions>
          <BeginStoryboard Storyboard="{StaticResource OnMouseEnter1}" />
        </Trigger.EnterActions>
        <Trigger.ExitActions>
          <BeginStoryboard Storyboard="{StaticResource OnMouseLeave1}" />
        </Trigger.ExitActions>
      </Trigger>
      <Trigger Property="IsDropDownOpen" Value="True">
        <Trigger.EnterActions>
          <BeginStoryboard Storyboard="{StaticResource OnMouseEnter1}" />
        </Trigger.EnterActions>
        <Trigger.ExitActions>
          <BeginStoryboard Storyboard="{StaticResource OnMouseLeave1}" />
        </Trigger.ExitActions>
      </Trigger>
      <Trigger Property="IsLauncherVisible" Value="False">
        <Setter Property="Visibility" TargetName="PART_DialogLauncherButton" Value="Collapsed" />
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <ControlTemplate x:Key="RibbonDropDownButtonControlTemplate" TargetType="{x:Type Fluent:DropDownButton}">
    <ControlTemplate.Resources>
      <Style BasedOn="{StaticResource MenuSeparatorStyle}" TargetType="{x:Type Separator}" />
    </ControlTemplate.Resources>
    <Grid>
      <Border x:Name="PART_ButtonBorder" BorderThickness="1" CornerRadius="2" Background="{StaticResource TransparentBrush}" BorderBrush="{StaticResource TransparentBrush}" Height="Auto" HorizontalAlignment="Left" VerticalAlignment="Stretch" d:LayoutOverrides="Width, Height">
        <Border x:Name="border1" Height="Auto" BorderBrush="{StaticResource TransparentBrush}" BorderThickness="1" CornerRadius="2" Background="{StaticResource TransparentBrush}">
          <Grid Height="Auto">
            <Rectangle x:Name="rectangle" StrokeThickness="0" Visibility="Collapsed">
              <Rectangle.Fill>
                <RadialGradientBrush Center="0.503,1" GradientOrigin="0.503,1" RadiusY="0.202">
                  <GradientStop Color="#7FFFFFFF" Offset="0" />
                  <GradientStop Offset="1" />
                </RadialGradientBrush>
              </Rectangle.Fill>
            </Rectangle>
            <StackPanel x:Name="stackPanel" Width="Auto" Orientation="Vertical" d:LayoutOverrides="Width, Height">
              <ContentPresenter x:Name="iconImage" HorizontalAlignment="Center" Height="32" VerticalAlignment="Center" Content="{Binding LargeIcon, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource StringToImageConvert}}" Width="32" Margin="3,2" SnapsToDevicePixels="True" />
              <Fluent:TwoLineLabel x:Name="controlLabel" Text="{TemplateBinding Header}" Style="{StaticResource TwoLineLabelStyle}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2,-2,2,2" HasGlyph="{TemplateBinding HasTriangle}" />
            </StackPanel>
          </Grid>
        </Border>
      </Border>
      <Popup x:Name="PART_Popup" Placement="Bottom" IsOpen="{TemplateBinding IsDropDownOpen}" AllowsTransparency="True" PopupAnimation="Fade" Margin="0,0,-4,0" VerticalAlignment="Top" Grid.ColumnSpan="2">
        <Grid Name="DropDown" SnapsToDevicePixels="True" Margin="0" VerticalAlignment="Top">
          <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="10" />
          </Grid.RowDefinitions>
          <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="10" />
          </Grid.ColumnDefinitions>
          <Rectangle HorizontalAlignment="Left" VerticalAlignment="Top" Width="4" Height="4" Grid.Row="1" Grid.Column="1" StrokeThickness="0" Margin="-1,-1,0,0">
            <Rectangle.Fill>
              <RadialGradientBrush RadiusX="0.984" Center="0.017,0.002" GradientOrigin="0.017,0.002" RadiusY="1">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="-1,3,0,0" VerticalAlignment="Top" Width="4" Height="4" Grid.Column="1" Grid.Row="0">
            <Rectangle.Fill>
              <RadialGradientBrush Center="0.032,1.01" GradientOrigin="0.032,1.01" RadiusX="0.984" RadiusY="1">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="3,-1,0,0" VerticalAlignment="Top" Width="4" Height="4" Grid.Column="0" Grid.Row="1">
            <Rectangle.Fill>
              <RadialGradientBrush Center="0.996,0.027" GradientOrigin="0.996,0.027" RadiusX="0.984" RadiusY="1">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Stretch" Margin="7,-1,1,0" VerticalAlignment="Top" Width="Auto" Height="4" Grid.Column="0" Grid.Row="1">
            <Rectangle.Fill>
              <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" MappingMode="RelativeToBoundingBox">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </LinearGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="-1,7,0,1" VerticalAlignment="Stretch" Width="4" Height="Auto" Grid.Column="1" Grid.Row="0">
            <Rectangle.Fill>
              <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5" MappingMode="RelativeToBoundingBox">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </LinearGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Border x:Name="PART_DropDownBorder" MinWidth="{TemplateBinding ActualWidth}" SnapsToDevicePixels="True" Background="{StaticResource ContextMenuBarBackgroundBrush}" BorderBrush="{StaticResource ContextMenuBarBorderBrush}" BorderThickness="1" CornerRadius="1" Grid.ColumnSpan="1" d:LayoutOverrides="Width, Height" HorizontalAlignment="Stretch" VerticalAlignment="Top">
            <Grid Width="Auto" Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Top">
              <Border VerticalAlignment="Top" Width="Auto" Height="Auto" BorderBrush="{StaticResource ContextMenuBarBackgroundBrush}" BorderThickness="1" CornerRadius="1" />
              <Grid Margin="1" HorizontalAlignment="Stretch" VerticalAlignment="Top">
                <Grid.RowDefinitions>
                  <RowDefinition Height="*" />
                  <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Rectangle Fill="{x:Null}" Stretch="Fill" Stroke="#FFE2E4E7" HorizontalAlignment="Left" Margin="24,0,0,0" Width="1" Height="Auto" Grid.RowSpan="2" Visibility="Visible" VerticalAlignment="Stretch" />
                <ScrollViewer x:Name="PART_ScrollViewer" Style="{StaticResource MenuScrollViewer}" IsTabStop="False" Margin="1" MaxHeight="{TemplateBinding MaxDropDownHeight}" SnapsToDevicePixels="True" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Hidden">
                  <Fluent:MenuPanel x:Name="PART_MenuPanel" IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Local" />
                </ScrollViewer>
                <Border x:Name="resizeBorder" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="11" BorderBrush="{StaticResource ContextMenuBarResizeBorderBrush}" BorderThickness="0,1,0,0" Grid.Row="1" CornerRadius="0,0,1,1" Background="{StaticResource ContextMenuBarResizeBackgoundBrush}">
                  <Grid>
                    <Thumb x:Name="PART_ResizeVerticalThumb" HorizontalAlignment="Stretch" Margin="0,0,0,-90" Width="Auto" Height="10" VerticalAlignment="Top" Cursor="SizeNS" Template="{StaticResource ResizeVerticalThumbControlTemplate}" />
                    <Thumb x:Name="PART_ResizeBothThumb" HorizontalAlignment="Right" Margin="0,0,0,-90" Width="10" Height="10" VerticalAlignment="Top" Cursor="SizeNWSE" Template="{StaticResource ResizeBothThumbControlTemplate}" />
                  </Grid>
                </Border>
              </Grid>
            </Grid>
          </Border>
        </Grid>
      </Popup>
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="ResizeMode" Value="None">
        <Setter Property="Visibility" TargetName="resizeBorder" Value="Collapsed" />
      </Trigger>
      <Trigger Property="ResizeMode" Value="Both">
        <Setter Property="Visibility" TargetName="PART_ResizeVerticalThumb" Value="Collapsed" />
        <Setter Property="Visibility" TargetName="PART_ResizeBothThumb" Value="Visible" />
        <Setter Property="Visibility" TargetName="resizeBorder" Value="Visible" />
      </Trigger>
      <Trigger Property="ResizeMode" Value="Vertical">
        <Setter Property="Visibility" TargetName="PART_ResizeBothThumb" Value="Collapsed" />
        <Setter Property="Visibility" TargetName="PART_ResizeVerticalThumb" Value="Visible" />
        <Setter Property="Visibility" TargetName="resizeBorder" Value="Visible" />
      </Trigger>
      <Trigger Property="Size" Value="Small">
        <Setter Property="Orientation" TargetName="stackPanel" Value="Horizontal" />
        <Setter Property="Content" TargetName="iconImage" Value="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource StringToImageConvert}}" />
        <Setter Property="HasTwoLines" TargetName="controlLabel" Value="False" />
        <Setter Property="Text" TargetName="controlLabel" Value="" />
        <Setter Property="Width" TargetName="iconImage" Value="16" />
        <Setter Property="Height" TargetName="iconImage" Value="16" />
        <Setter Property="Margin" TargetName="iconImage" Value="1,0,0,0" />
        <Setter Property="Margin" TargetName="controlLabel" Value="-2,-1,2,1" />
        <Setter Property="Width" TargetName="controlLabel" Value="10" />
        <Setter Property="VerticalAlignment" TargetName="controlLabel" Value="Center" />
      </Trigger>
      <Trigger Property="Size" Value="Middle">
        <Setter Property="Orientation" TargetName="stackPanel" Value="Horizontal" />
        <Setter Property="Content" TargetName="iconImage" Value="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource StringToImageConvert}}" />
        <Setter Property="Width" TargetName="stackPanel" Value="Auto" />
        <Setter Property="VerticalAlignment" TargetName="iconImage" Value="Center" />
        <Setter Property="HasTwoLines" TargetName="controlLabel" Value="False" />
        <Setter Property="Margin" TargetName="controlLabel" Value="2,-1,2,1" />
        <Setter Property="VerticalAlignment" TargetName="PART_ButtonBorder" Value="Stretch" />
        <Setter Property="Width" TargetName="iconImage" Value="16" />
        <Setter Property="Height" TargetName="iconImage" Value="16" />
        <Setter Property="Margin" TargetName="iconImage" Value="1,0,2,0" />
        <Setter Property="VerticalAlignment" TargetName="controlLabel" Value="Center" />
      </Trigger>
      <Trigger Property="IsDropDownOpen" Value="True">
        <Setter Property="BorderBrush" TargetName="PART_ButtonBorder" Value="{StaticResource ButtonPressedOuterBorderBrush}" />
        <Setter Property="Background" TargetName="PART_ButtonBorder" Value="{StaticResource ButtonPressedOuterBackgroundBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonPressedInnerBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonPressedInnerBorderBrush}" />
        <Setter Property="Visibility" TargetName="rectangle" Value="Visible" />
      </Trigger>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="Opacity" TargetName="iconImage" Value="0.5" />
        <Setter Property="Opacity" TargetName="controlLabel" Value="0.5" />
        <Setter Property="Effect" TargetName="iconImage">
          <Setter.Value>
            <Fluent:GrayscaleEffect />
          </Setter.Value>
        </Setter>
      </Trigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsMouseOver" Value="True" />
          <Condition Property="IsDropDownOpen" Value="False" />
        </MultiTrigger.Conditions>
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
        <Setter Property="Background" TargetName="PART_ButtonBorder" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="PART_ButtonBorder" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
        <Setter Property="Visibility" TargetName="rectangle" Value="Visible" />
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsFocused" Value="True" />
          <Condition Property="IsDropDownOpen" Value="False" />
        </MultiTrigger.Conditions>
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
        <Setter Property="Background" TargetName="PART_ButtonBorder" Value="{StaticResource ButtonHoverOuterBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="PART_ButtonBorder" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
        <Setter Property="Visibility" TargetName="rectangle" Value="Visible" />
      </MultiTrigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <ControlTemplate x:Key="RibbonSplitButtonControlTemplate" TargetType="{x:Type Fluent:SplitButton}">
    <ControlTemplate.Resources>
      <Style BasedOn="{StaticResource MenuSeparatorStyle}" TargetType="{x:Type Separator}" />
    </ControlTemplate.Resources>
    <Grid>
      <Border x:Name="PART_ButtonBorder" BorderThickness="1" CornerRadius="2" Background="{StaticResource TransparentBrush}" BorderBrush="{StaticResource TransparentBrush}" Height="Auto" HorizontalAlignment="Left" VerticalAlignment="Stretch" SnapsToDevicePixels="True" ToolTip="{TemplateBinding DropDownToolTip}">
        <Border x:Name="border1" Height="Auto" BorderBrush="{StaticResource TransparentBrush}" BorderThickness="1" CornerRadius="2" Background="{StaticResource TransparentBrush}">
          <Grid x:Name="grid" Height="Auto">
            <Rectangle x:Name="rectangle" StrokeThickness="0" Visibility="Collapsed">
              <Rectangle.Fill>
                <RadialGradientBrush Center="0.503,1" GradientOrigin="0.503,1" RadiusY="0.202">
                  <GradientStop Color="#7FFFFFFF" Offset="0" />
                  <GradientStop Offset="1" />
                </RadialGradientBrush>
              </Rectangle.Fill>
            </Rectangle>
            <Border x:Name="downRect" VerticalAlignment="Bottom" Height="28" Background="{StaticResource TransparentBrush}" BorderThickness="0,1,0,0" Margin="-1,0" />
            <Border x:Name="downRect_Copy" VerticalAlignment="Bottom" Height="27" Background="{StaticResource TransparentBrush}" BorderThickness="1" Margin="-1,1,-1,0" IsHitTestVisible="False" />
            <StackPanel x:Name="stackPanel" Width="Auto" Orientation="Vertical" d:LayoutOverrides="Width, Height" IsHitTestVisible="False" Margin="0">
              <ContentPresenter x:Name="iconImage" HorizontalAlignment="Center" Height="32" VerticalAlignment="Center" Content="{x:Null}" Width="32" Margin="3,2" SnapsToDevicePixels="True" IsHitTestVisible="false" Visibility="Hidden" />
              <Fluent:TwoLineLabel x:Name="controlLabel" Text="{TemplateBinding Header}" Style="{StaticResource TwoLineLabelStyle}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2,-2,2,2" HasGlyph="{TemplateBinding HasTriangle}" />
            </StackPanel>
            <Fluent:ToggleButton x:Name="PART_Button" Command="{TemplateBinding Command}" CommandParameter="{TemplateBinding CommandParameter}" CommandTarget="{TemplateBinding CommandTarget}" Margin="-2,-2,-2,26" Height="Auto" Width="Auto" Style="{StaticResource InnerButtonStyle}" LargeIcon="{Binding LargeIcon, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource StringToImageConvert}}" Icon="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource StringToImageConvert}}" IsEnabled="{TemplateBinding IsButtonEnabled}" Header="{TemplateBinding Header}" ToolTip="{TemplateBinding ToolTip}" IsChecked="{Binding IsChecked, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" IsDefinitive="{TemplateBinding IsDefinitive}" CanAddToQuickAccessToolBar="{TemplateBinding CanAddButtonToQuickAccessToolBar}" />
          </Grid>
        </Border>
      </Border>
      <Popup x:Name="PART_Popup" Placement="Bottom" IsOpen="{TemplateBinding IsDropDownOpen}" AllowsTransparency="True" Focusable="False" PopupAnimation="Fade" Margin="0,0,-4,0" VerticalAlignment="Top" Grid.ColumnSpan="2">
        <Grid Name="DropDown" SnapsToDevicePixels="True" Margin="0" VerticalAlignment="Top">
          <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="10" />
          </Grid.RowDefinitions>
          <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="10" />
          </Grid.ColumnDefinitions>
          <Rectangle HorizontalAlignment="Left" VerticalAlignment="Top" Width="4" Height="4" Grid.Row="1" Grid.Column="1" StrokeThickness="0" Margin="-1,-1,0,0">
            <Rectangle.Fill>
              <RadialGradientBrush RadiusX="0.984" Center="0.017,0.002" GradientOrigin="0.017,0.002" RadiusY="1">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="-1,3,0,0" VerticalAlignment="Top" Width="4" Height="4" Grid.Column="1" Grid.Row="0">
            <Rectangle.Fill>
              <RadialGradientBrush Center="0.032,1.01" GradientOrigin="0.032,1.01" RadiusX="0.984" RadiusY="1">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="3,-1,0,0" VerticalAlignment="Top" Width="4" Height="4" Grid.Column="0" Grid.Row="1">
            <Rectangle.Fill>
              <RadialGradientBrush Center="0.996,0.027" GradientOrigin="0.996,0.027" RadiusX="0.984" RadiusY="1">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </RadialGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Stretch" Margin="7,-1,1,0" VerticalAlignment="Top" Width="Auto" Height="4" Grid.Column="0" Grid.Row="1">
            <Rectangle.Fill>
              <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" MappingMode="RelativeToBoundingBox">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </LinearGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="-1,7,0,1" VerticalAlignment="Stretch" Width="4" Height="Auto" Grid.Column="1" Grid.Row="0">
            <Rectangle.Fill>
              <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5" MappingMode="RelativeToBoundingBox">
                <GradientStop Color="#3F000000" Offset="0" />
                <GradientStop Color="#00000000" Offset="1" />
              </LinearGradientBrush>
            </Rectangle.Fill>
          </Rectangle>
          <Border x:Name="PART_DropDownBorder" MinWidth="{TemplateBinding ActualWidth}" SnapsToDevicePixels="True" Background="{StaticResource ContextMenuBarBackgroundBrush}" BorderBrush="{StaticResource ContextMenuBarBorderBrush}" BorderThickness="1" CornerRadius="1" Grid.ColumnSpan="1" d:LayoutOverrides="Width, Height" HorizontalAlignment="Stretch" VerticalAlignment="Top">
            <Grid Width="Auto" Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Top">
              <Border VerticalAlignment="Top" Width="Auto" Height="Auto" BorderBrush="{StaticResource ContextMenuBarBackgroundBrush}" BorderThickness="1" CornerRadius="1" />
              <Grid Margin="1" HorizontalAlignment="Stretch" VerticalAlignment="Top">
                <Grid.RowDefinitions>
                  <RowDefinition Height="*" />
                  <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Rectangle Fill="{x:Null}" Stretch="Fill" Stroke="#FFE2E4E7" HorizontalAlignment="Left" Margin="24,0,0,0" Width="1" Height="Auto" Grid.RowSpan="2" Visibility="Visible" VerticalAlignment="Stretch" />
                <ScrollViewer x:Name="PART_ScrollViewer" Style="{StaticResource MenuScrollViewer}" Margin="1" MaxHeight="{TemplateBinding MaxDropDownHeight}" SnapsToDevicePixels="True" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Hidden">
                  <Fluent:MenuPanel x:Name="PART_MenuPanel" IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle" />
                </ScrollViewer>
                <Border x:Name="resizeBorder" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="11" BorderBrush="{StaticResource ContextMenuBarResizeBorderBrush}" BorderThickness="0,1,0,0" Grid.Row="1" CornerRadius="0,0,1,1" Background="{StaticResource ContextMenuBarResizeBackgoundBrush}">
                  <Grid>
                    <Thumb x:Name="PART_ResizeVerticalThumb" HorizontalAlignment="Stretch" Margin="0,0,0,-90" Width="Auto" Height="10" VerticalAlignment="Top" Cursor="SizeNS" Template="{StaticResource ResizeVerticalThumbControlTemplate}" />
                    <Thumb x:Name="PART_ResizeBothThumb" HorizontalAlignment="Right" Margin="0,0,0,-90" Width="10" Height="10" VerticalAlignment="Top" Cursor="SizeNWSE" Template="{StaticResource ResizeBothThumbControlTemplate}" />
                  </Grid>
                </Border>
              </Grid>
            </Grid>
          </Border>
        </Grid>
      </Popup>
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="ResizeMode" Value="None">
        <Setter Property="Visibility" TargetName="resizeBorder" Value="Collapsed" />
      </Trigger>
      <Trigger Property="ResizeMode" Value="Both">
        <Setter Property="Visibility" TargetName="PART_ResizeVerticalThumb" Value="Collapsed" />
        <Setter Property="Visibility" TargetName="PART_ResizeBothThumb" Value="Visible" />
        <Setter Property="Visibility" TargetName="resizeBorder" Value="Visible" />
      </Trigger>
      <Trigger Property="ResizeMode" Value="Vertical">
        <Setter Property="Visibility" TargetName="PART_ResizeBothThumb" Value="Collapsed" />
        <Setter Property="Visibility" TargetName="PART_ResizeVerticalThumb" Value="Visible" />
        <Setter Property="Visibility" TargetName="resizeBorder" Value="Visible" />
      </Trigger>
      <Trigger Property="IsChecked" Value="True">
        <Setter Property="BorderBrush" TargetName="PART_ButtonBorder" Value="{StaticResource ButtonPressedOuterBorderBrush}" />
        <Setter Property="Background" TargetName="PART_ButtonBorder" Value="{StaticResource ButtonPressedInnerBorderBrush}" />
        <Setter Property="BorderBrush" TargetName="downRect" Value="{StaticResource ButtonPressedOuterBorderBrush}" />
      </Trigger>
      <Trigger Property="Size" Value="Small">
        <Setter Property="Orientation" TargetName="stackPanel" Value="Horizontal" />
        <!--        <Setter Property="Content" TargetName="iconImage" Value="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource StringToImageConvert}}"/>-->
        <Setter Property="HasTwoLines" TargetName="controlLabel" Value="False" />
        <Setter Property="Text" TargetName="controlLabel" Value="" />
        <Setter Property="Width" TargetName="iconImage" Value="16" />
        <Setter Property="Height" TargetName="iconImage" Value="16" />
        <Setter Property="Margin" TargetName="iconImage" Value="1,0,0,0" />
        <Setter Property="Margin" TargetName="controlLabel" Value="3,-1,0,1" />
        <Setter Property="Margin" TargetName="PART_Button" Value="-2,-2,10,-2" />
        <Setter Property="VerticalAlignment" TargetName="downRect" Value="Stretch" />
        <Setter Property="HorizontalAlignment" TargetName="downRect" Value="Right" />
        <Setter Property="Height" TargetName="downRect" Value="Auto" />
        <Setter Property="Margin" TargetName="downRect" Value="-1,-2,-1,-1" />
        <Setter Property="HorizontalAlignment" TargetName="controlLabel" Value="Right" />
        <Setter Property="BorderThickness" TargetName="downRect" Value="1,0,0,0" />
        <Setter Property="Margin" TargetName="downRect_Copy" Value="-1" />
        <Setter Property="VerticalAlignment" TargetName="downRect_Copy" Value="Stretch" />
        <Setter Property="HorizontalAlignment" TargetName="downRect_Copy" Value="Right" />
        <Setter Property="Height" TargetName="downRect_Copy" Value="Auto" />
        <Setter Property="Width" TargetName="downRect" Value="12" />
        <Setter Property="Width" TargetName="downRect_Copy" Value="11" />
        <Setter Property="Width" TargetName="controlLabel" Value="12" />
        <Setter Property="Size" TargetName="PART_Button" Value="Small" />
        <Setter Property="VerticalAlignment" TargetName="controlLabel" Value="Center" />
      </Trigger>
      <Trigger Property="Size" Value="Middle">
        <Setter Property="Orientation" TargetName="stackPanel" Value="Horizontal" />
        <!--        <Setter Property="Content" TargetName="iconImage" Value="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource StringToImageConvert}}"/>-->
        <Setter Property="VerticalAlignment" TargetName="iconImage" Value="Center" />
        <Setter Property="HasTwoLines" TargetName="controlLabel" Value="False" />
        <Setter Property="Margin" TargetName="controlLabel" Value="3,-1,-2,1" />
        <Setter Property="VerticalAlignment" TargetName="PART_ButtonBorder" Value="Stretch" />
        <Setter Property="Width" TargetName="iconImage" Value="16" />
        <Setter Property="Height" TargetName="iconImage" Value="16" />
        <Setter Property="Margin" TargetName="iconImage" Value="1,0,2,0" />
        <Setter Property="Margin" TargetName="PART_Button" Value="-2,-2,10,-2" />
        <Setter Property="HorizontalAlignment" TargetName="downRect" Value="Right" />
        <Setter Property="VerticalAlignment" TargetName="downRect" Value="Stretch" />
        <Setter Property="Height" TargetName="downRect" Value="Auto" />
        <Setter Property="Style" TargetName="PART_Button" Value="{StaticResource InnerButtonStyle}" />
        <Setter Property="Margin" TargetName="downRect" Value="-1,-2,-1,-1" />
        <Setter Property="HorizontalAlignment" TargetName="downRect_Copy" Value="Right" />
        <Setter Property="VerticalAlignment" TargetName="downRect_Copy" Value="Stretch" />
        <Setter Property="Height" TargetName="downRect_Copy" Value="Auto" />
        <Setter Property="Margin" TargetName="downRect_Copy" Value="-1" />
        <Setter Property="Width" TargetName="downRect" Value="12" />
        <Setter Property="Width" TargetName="downRect_Copy" Value="11" />
        <Setter Property="Size" TargetName="PART_Button" Value="Middle" />
        <Setter Property="BorderThickness" TargetName="downRect" Value="1,0,0,0" />
        <Setter Property="Text" TargetName="controlLabel" Value="" />
        <Setter Property="HorizontalAlignment" TargetName="stackPanel" Value="Right" />
        <Setter Property="Width" TargetName="stackPanel" Value="Auto" />
        <Setter Property="Width" TargetName="controlLabel" Value="12" />
        <Setter Property="HorizontalAlignment" TargetName="grid" Value="Stretch" />
        <Setter Property="VerticalAlignment" TargetName="controlLabel" Value="Center" />
        <Setter Property="HorizontalAlignment" TargetName="controlLabel" Value="Right" />
      </Trigger>
      <Trigger Property="IsDropDownOpen" Value="True">
        <Setter Property="BorderBrush" TargetName="PART_ButtonBorder" Value="{StaticResource ButtonPressedOuterBorderBrush}" />
        <Setter Property="Background" TargetName="border1" Value="{StaticResource ButtonPressedInnerBackgroundBrush}" />
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonPressedInnerBorderBrush}" />
        <Setter Property="BorderBrush" TargetName="downRect" Value="{StaticResource ButtonPressedOuterBorderBrush}" />
        <Setter Property="Visibility" TargetName="rectangle" Value="Visible" />
      </Trigger>
      <Trigger Property="IsButtonEnabled" Value="False">
        <Setter Property="Opacity" TargetName="iconImage" Value="0.5" />
        <Setter Property="Effect" TargetName="iconImage">
          <Setter.Value>
            <Fluent:GrayscaleEffect />
          </Setter.Value>
        </Setter>
      </Trigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsMouseOver" Value="True" />
          <Condition Property="IsDropDownOpen" Value="False" />
        </MultiTrigger.Conditions>
        <Setter Property="BorderBrush" TargetName="border1" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
        <Setter Property="BorderBrush" TargetName="PART_ButtonBorder" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
        <Setter Property="BorderBrush" TargetName="downRect" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
        <Setter Property="Visibility" TargetName="rectangle" Value="Visible" />
      </MultiTrigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsMouseOver" SourceName="downRect" Value="True" />
          <Condition Property="IsDropDownOpen" Value="False" />
        </MultiTrigger.Conditions>
        <Setter Property="Background" TargetName="downRect" Value="{StaticResource ButtonPressedInnerBackgroundBrush}" />
        <Setter Property="Visibility" TargetName="rectangle" Value="Visible" />
        <Setter Property="BorderBrush" TargetName="downRect" Value="{StaticResource ButtonHoverOuterBorderBrush}" />
        <Setter Property="BorderBrush" TargetName="downRect_Copy" Value="{StaticResource ButtonHoverInnerBorderBrush}" />
        <Setter Property="Background" TargetName="downRect_Copy" Value="{StaticResource ButtonHoverInnerBackgroundBrush}" />
      </MultiTrigger>
      <!--<MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsFocused" Value="True"/>
          <Condition Property="IsDropDownOpen" Value="False"/>
        </MultiTrigger.Conditions>
        <Setter Property="BorderBrush" TargetName="border1" Value="{DynamicResource ButtonHoverInnerBorderBrush}"/>
        <Setter Property="Background" TargetName="downRect" Value="{DynamicResource ButtonHoverInnerBackgroundBrush}"/>        
        <Setter Property="BorderBrush" TargetName="PART_ButtonBorder" Value="{DynamicResource ButtonHoverOuterBorderBrush}"/>
        <Setter Property="BorderBrush" TargetName="downRect" Value="{DynamicResource ButtonHoverOuterBorderBrush}"/>
        <Setter Property="Visibility" TargetName="rectangle" Value="Visible"/>
      </MultiTrigger>-->
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <ControlTemplate x:Key="QuickAccessToolbarControlTemplate" TargetType="{x:Type Fluent:QuickAccessToolBar}">
    <DockPanel x:Name="PART_RootPanel">
      <ContentControl x:Name="menuContentControl" DockPanel.Dock="Right" HorizontalAlignment="Right" Focusable="False">
        <Fluent:DropDownButton CanAddToQuickAccessToolBar="False" x:Name="PART_MenuDownButton" Width="13" HorizontalAlignment="Right" VerticalAlignment="Stretch" Style="{StaticResource ToolbarDropDownButtonStyle}" Height="22" DockPanel.Dock="Right" IsEnabled="{TemplateBinding IsEnabled}" Icon="pack://application:,,,/Fluent;Component/Themes/Office2010/Images/QuickAccessToolBarDropDown.png" Size="Small" ToolTip="{Binding Source={x:Static Fluent:Ribbon.Localization}, Path=QuickAccessToolBarDropDownButtonTooltip, Mode=OneWay}">
          <Fluent:GroupSeparatorMenuItem Style="{StaticResource MenuGroupSeparatorStyle}" Header="{Binding Source={x:Static Fluent:Ribbon.Localization}, Path=QuickAccessToolBarMenuHeader, Mode=OneWay}" />
          <StackPanel x:Name="PART_MenuPanel" />
          <Separator x:Name="menuSeparator" Style="{StaticResource MenuSeparatorStyle}" />
          <Fluent:MenuItem x:Name="PART_ShowBelow" Header="{Binding Source={x:Static Fluent:Ribbon.Localization}, Path=QuickAccessToolBarMenuShowBelow, Mode=OneWay}" />
          <Fluent:MenuItem x:Name="PART_ShowAbove" Header="{Binding Source={x:Static Fluent:Ribbon.Localization}, Path=QuickAccessToolBarMenuShowAbove, Mode=OneWay}" Visibility="Collapsed" />
        </Fluent:DropDownButton>
      </ContentControl>
      <Fluent:DropDownButton x:Name="PART_ToolbarDownButton" HorizontalAlignment="Right" Width="13" Visibility="Collapsed" VerticalAlignment="Stretch" Style="{StaticResource ToolbarDropDownButtonStyle}" Height="22" DockPanel.Dock="Right" Fluent:KeyTip.Keys="00" Size="Small" IsEnabled="{TemplateBinding IsEnabled}" Icon="pack://application:,,,/Fluent;Component/Themes/Office2010/Images/QuickAccessToolBarExtender.png" ToolTip="{Binding Source={x:Static Fluent:Ribbon.Localization}, Path=QuickAccessToolBarMoreControlsButtonTooltip, Mode=OneWay}">
        <Fluent:DropDownButton.ContextMenu>
          <ContextMenu />
        </Fluent:DropDownButton.ContextMenu>
        <StackPanel Orientation="Horizontal" Background="{StaticResource QuickAccessToolbarPopupBackgrondBrush}" Width="Auto" Height="26" Margin="-1">
          <StackPanel Orientation="Horizontal" x:Name="PART_ToolBarOverflowPanel" HorizontalAlignment="Left" Width="Auto" Height="Auto" VerticalAlignment="Center" Margin="1,0,0,0" />
          <Label x:Name="popupContentControl" VerticalAlignment="Center" HorizontalAlignment="Left" Width="13" Background="{x:Null}" Height="22" Focusable="False" Padding="0" Margin="1,0" />
        </StackPanel>
      </Fluent:DropDownButton>
      <Rectangle x:Name="rectangle" Fill="Black" Stroke="White" RadiusX="1" RadiusY="1" HorizontalAlignment="Right" Width="3" Height="15" Opacity="0.5" VerticalAlignment="Stretch" DockPanel.Dock="Right" />
      <Rectangle x:Name="rectangle1" Fill="Black" Stroke="White" Width="3" Height="15" RadiusX="1" RadiusY="1" HorizontalAlignment="Left" Opacity="0.5" VerticalAlignment="Stretch" DockPanel.Dock="Left" />
      <StackPanel Orientation="Horizontal" x:Name="PART_ToolBarPanel" Width="Auto" Height="Auto" VerticalAlignment="Stretch" FocusManager.IsFocusScope="False" />
    </DockPanel>
    <ControlTemplate.Triggers>
      <Trigger Property="CanQuickAccessLocationChanging" Value="False">
        <Setter Property="Visibility" TargetName="PART_ShowBelow" Value="Collapsed" />
        <Setter Property="Visibility" TargetName="PART_ShowAbove" Value="Collapsed" />
        <Setter Property="Visibility" TargetName="menuSeparator" Value="Collapsed" />
      </Trigger>
      <Trigger Property="ShowAboveRibbon" Value="False">
        <Setter Property="Visibility" TargetName="PART_ShowBelow" Value="Collapsed" />
        <Setter Property="Visibility" TargetName="PART_ShowAbove" Value="Visible" />
        <Setter Property="Visibility" TargetName="rectangle" Value="Collapsed" />
        <Setter Property="Visibility" TargetName="rectangle1" Value="Collapsed" />
      </Trigger>
      <Trigger Property="HasOverflowItems" Value="True">
        <Setter Property="Visibility" TargetName="PART_ToolbarDownButton" Value="Visible" />
        <Setter Property="Content" TargetName="popupContentControl" Value="{Binding ElementName=PART_MenuDownButton, Mode=OneWay}" />
        <Setter Property="Content" TargetName="menuContentControl" Value="{x:Null}" />
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <ControlTemplate x:Key="FluentPopupMenuControlTemplate" TargetType="{x:Type Fluent:ContextMenu}">
    <ControlTemplate.Resources>
      <Style BasedOn="{StaticResource MenuSeparatorStyle}" TargetType="{x:Type Separator}" />
      <Style TargetType="{x:Type Fluent:GroupSeparatorMenuItem}" BasedOn="{StaticResource MenuGroupSeparatorStyle}" />
    </ControlTemplate.Resources>
    <Grid Height="Auto" HorizontalAlignment="Left" VerticalAlignment="Top">
      <Grid.RowDefinitions>
        <RowDefinition Height="*" />
        <RowDefinition Height="10" />
      </Grid.RowDefinitions>
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="*" />
        <ColumnDefinition Width="10" />
      </Grid.ColumnDefinitions>
      <Rectangle HorizontalAlignment="Left" VerticalAlignment="Top" Width="4" Height="4" Grid.Row="1" Grid.Column="1" StrokeThickness="0" Margin="-1,-1,0,0">
        <Rectangle.Fill>
          <RadialGradientBrush RadiusX="0.984" Center="0.017,0.002" GradientOrigin="0.017,0.002" RadiusY="1">
            <GradientStop Color="#3F000000" Offset="0" />
            <GradientStop Color="#00000000" Offset="1" />
          </RadialGradientBrush>
        </Rectangle.Fill>
      </Rectangle>
      <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="-1,3,0,0" VerticalAlignment="Top" Width="4" Height="4" Grid.Column="1" Grid.Row="0">
        <Rectangle.Fill>
          <RadialGradientBrush Center="0.032,1.01" GradientOrigin="0.032,1.01" RadiusX="0.984" RadiusY="1">
            <GradientStop Color="#3F000000" Offset="0" />
            <GradientStop Color="#00000000" Offset="1" />
          </RadialGradientBrush>
        </Rectangle.Fill>
      </Rectangle>
      <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="3,-1,0,0" VerticalAlignment="Top" Width="4" Height="4" Grid.Column="0" Grid.Row="1">
        <Rectangle.Fill>
          <RadialGradientBrush Center="0.996,0.027" GradientOrigin="0.996,0.027" RadiusX="0.984" RadiusY="1">
            <GradientStop Color="#3F000000" Offset="0" />
            <GradientStop Color="#00000000" Offset="1" />
          </RadialGradientBrush>
        </Rectangle.Fill>
      </Rectangle>
      <Rectangle StrokeThickness="0" HorizontalAlignment="Stretch" Margin="7,-1,1,0" VerticalAlignment="Top" Width="Auto" Height="4" Grid.Column="0" Grid.Row="1">
        <Rectangle.Fill>
          <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" MappingMode="RelativeToBoundingBox">
            <GradientStop Color="#3F000000" Offset="0" />
            <GradientStop Color="#00000000" Offset="1" />
          </LinearGradientBrush>
        </Rectangle.Fill>
      </Rectangle>
      <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="-1,7,0,1" VerticalAlignment="Stretch" Width="4" Height="Auto" Grid.Column="1" Grid.Row="0">
        <Rectangle.Fill>
          <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5" MappingMode="RelativeToBoundingBox">
            <GradientStop Color="#3F000000" Offset="0" />
            <GradientStop Color="#00000000" Offset="1" />
          </LinearGradientBrush>
        </Rectangle.Fill>
      </Rectangle>
      <Border SnapsToDevicePixels="True" Background="{StaticResource ContextMenuBarBackgroundBrush}" BorderBrush="{StaticResource ContextMenuBarBorderBrush}" BorderThickness="1" CornerRadius="1" Grid.ColumnSpan="1" d:LayoutOverrides="Width, Height" HorizontalAlignment="Left" VerticalAlignment="Top">
        <Grid Width="Auto" Height="Auto" HorizontalAlignment="Left" VerticalAlignment="Top">
          <Border VerticalAlignment="Stretch" Width="Auto" Height="Auto" BorderBrush="{StaticResource ContextMenuBarBackgroundBrush}" BorderThickness="1" CornerRadius="1" />
          <Grid Margin="1" HorizontalAlignment="Left" VerticalAlignment="Top">
            <Grid.RowDefinitions>
              <RowDefinition Height="*" />
              <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Rectangle Fill="{x:Null}" Stretch="Fill" Stroke="{StaticResource ContextMenuLineBrush}" HorizontalAlignment="Left" Margin="24,0,0,0" Width="1" Height="Auto" Grid.RowSpan="2" Visibility="Visible" />
            <ScrollViewer x:Name="PART_ScrollViewer" Style="{StaticResource MenuScrollViewer}" Margin="1" SnapsToDevicePixels="True" ScrollViewer.VerticalScrollBarVisibility="Auto">
              <Fluent:MenuPanel IsItemsHost="True" Margin="0" Width="Auto" Height="Auto" d:LayoutOverrides="Width, Height" Grid.RowSpan="1" x:Name="PART_ItemsHost" HorizontalAlignment="Left" VerticalAlignment="Top" />
            </ScrollViewer>
            <Border x:Name="resizeBorder" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="11" BorderBrush="{StaticResource ContextMenuBarResizeBorderBrush}" BorderThickness="0,1,0,0" Grid.Row="1" CornerRadius="0,0,1,1" Background="{StaticResource ContextMenuBarResizeBackgoundBrush}">
              <Grid>
                <Thumb x:Name="PART_ResizeVerticalThumb" HorizontalAlignment="Stretch" Margin="0,0,0,-90" Width="Auto" Height="10" VerticalAlignment="Top" Cursor="SizeNS" Template="{StaticResource ResizeVerticalThumbControlTemplate}" />
                <Thumb x:Name="PART_ResizeBothThumb" HorizontalAlignment="Right" Margin="0,0,0,-90" Width="10" Height="10" VerticalAlignment="Top" Cursor="SizeNWSE" Template="{StaticResource ResizeBothThumbControlTemplate}" />
              </Grid>
            </Border>
          </Grid>
        </Grid>
      </Border>
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="FlowDirection" Value="RightToLeft">
        <Setter Property="Cursor" TargetName="PART_ResizeBothThumb" Value="SizeNESW" />
      </Trigger>
      <Trigger Property="ResizeMode" Value="None">
        <Setter Property="Visibility" TargetName="resizeBorder" Value="Collapsed" />
      </Trigger>
      <Trigger Property="ResizeMode" Value="Both">
        <Setter Property="Visibility" TargetName="PART_ResizeVerticalThumb" Value="Collapsed" />
        <Setter Property="Visibility" TargetName="PART_ResizeBothThumb" Value="Visible" />
        <Setter Property="Visibility" TargetName="resizeBorder" Value="Visible" />
      </Trigger>
      <Trigger Property="ResizeMode" Value="Vertical">
        <Setter Property="Visibility" TargetName="PART_ResizeBothThumb" Value="Collapsed" />
        <Setter Property="Visibility" TargetName="PART_ResizeVerticalThumb" Value="Visible" />
        <Setter Property="Visibility" TargetName="resizeBorder" Value="Visible" />
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <ControlTemplate x:Key="PopupMenuControlTemplate" TargetType="{x:Type ContextMenu}">
    <ControlTemplate.Resources>
      <Style BasedOn="{StaticResource MenuSeparatorStyle}" TargetType="{x:Type Separator}" />
      <Style TargetType="{x:Type Fluent:GroupSeparatorMenuItem}" BasedOn="{StaticResource MenuGroupSeparatorStyle}" />
    </ControlTemplate.Resources>
    <Grid Height="Auto" HorizontalAlignment="Left" VerticalAlignment="Top">
      <Grid.RowDefinitions>
        <RowDefinition Height="*" />
        <RowDefinition Height="10" />
      </Grid.RowDefinitions>
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="*" />
        <ColumnDefinition Width="10" />
      </Grid.ColumnDefinitions>
      <Rectangle HorizontalAlignment="Left" VerticalAlignment="Top" Width="4" Height="4" Grid.Row="1" Grid.Column="1" StrokeThickness="0" Margin="-1,-1,0,0">
        <Rectangle.Fill>
          <RadialGradientBrush RadiusX="0.984" Center="0.017,0.002" GradientOrigin="0.017,0.002" RadiusY="1">
            <GradientStop Color="#3F000000" Offset="0" />
            <GradientStop Color="#00000000" Offset="1" />
          </RadialGradientBrush>
        </Rectangle.Fill>
      </Rectangle>
      <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="-1,3,0,0" VerticalAlignment="Top" Width="4" Height="4" Grid.Column="1" Grid.Row="0">
        <Rectangle.Fill>
          <RadialGradientBrush Center="0.032,1.01" GradientOrigin="0.032,1.01" RadiusX="0.984" RadiusY="1">
            <GradientStop Color="#3F000000" Offset="0" />
            <GradientStop Color="#00000000" Offset="1" />
          </RadialGradientBrush>
        </Rectangle.Fill>
      </Rectangle>
      <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="3,-1,0,0" VerticalAlignment="Top" Width="4" Height="4" Grid.Column="0" Grid.Row="1">
        <Rectangle.Fill>
          <RadialGradientBrush Center="0.996,0.027" GradientOrigin="0.996,0.027" RadiusX="0.984" RadiusY="1">
            <GradientStop Color="#3F000000" Offset="0" />
            <GradientStop Color="#00000000" Offset="1" />
          </RadialGradientBrush>
        </Rectangle.Fill>
      </Rectangle>
      <Rectangle StrokeThickness="0" HorizontalAlignment="Stretch" Margin="7,-1,1,0" VerticalAlignment="Top" Width="Auto" Height="4" Grid.Column="0" Grid.Row="1">
        <Rectangle.Fill>
          <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" MappingMode="RelativeToBoundingBox">
            <GradientStop Color="#3F000000" Offset="0" />
            <GradientStop Color="#00000000" Offset="1" />
          </LinearGradientBrush>
        </Rectangle.Fill>
      </Rectangle>
      <Rectangle StrokeThickness="0" HorizontalAlignment="Left" Margin="-1,7,0,1" VerticalAlignment="Stretch" Width="4" Height="Auto" Grid.Column="1" Grid.Row="0">
        <Rectangle.Fill>
          <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5" MappingMode="RelativeToBoundingBox">
            <GradientStop Color="#3F000000" Offset="0" />
            <GradientStop Color="#00000000" Offset="1" />
          </LinearGradientBrush>
        </Rectangle.Fill>
      </Rectangle>
      <Border SnapsToDevicePixels="True" Background="{StaticResource ContextMenuBarBackgroundBrush}" BorderBrush="{StaticResource ContextMenuBarBorderBrush}" BorderThickness="1" CornerRadius="1" Grid.ColumnSpan="1" d:LayoutOverrides="Width, Height" HorizontalAlignment="Left" VerticalAlignment="Top">
        <Grid Width="Auto" Height="Auto" HorizontalAlignment="Left" VerticalAlignment="Top">
          <Border VerticalAlignment="Stretch" Width="Auto" Height="Auto" BorderBrush="{StaticResource ContextMenuBarBackgroundBrush}" BorderThickness="1" CornerRadius="1" />
          <Grid Margin="1" HorizontalAlignment="Left" VerticalAlignment="Top">
            <Grid.RowDefinitions>
              <RowDefinition Height="*" />
              <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Rectangle Fill="{x:Null}" Stretch="Fill" Stroke="{StaticResource ContextMenuLineBrush}" HorizontalAlignment="Left" Margin="24,0,0,0" Width="1" Height="Auto" Grid.RowSpan="2" Visibility="Visible" />
            <ScrollViewer x:Name="PART_ScrollViewer" Style="{StaticResource MenuScrollViewer}" Margin="1" SnapsToDevicePixels="True" ScrollViewer.VerticalScrollBarVisibility="Auto">
              <StackPanel Margin="0" Width="Auto" Height="Auto" IsItemsHost="True" d:LayoutOverrides="Width, Height" Grid.RowSpan="1" x:Name="PART_ItemsHost" HorizontalAlignment="Left" VerticalAlignment="Top" />
            </ScrollViewer>
          </Grid>
        </Grid>
      </Border>
    </Grid>
  </ControlTemplate>
  <Style TargetType="{x:Type Fluent:ComboBox}" x:Key="ComboBoxBackstageStyle">
    <Setter Property="Template" Value="{StaticResource ComboBoxBackstageControlTemplate}" />
    <Setter Property="Height" Value="42" />
    <Setter Property="Width" Value="229" />
    <Setter Property="IsReadOnly" Value="True" />
    <Setter Property="IsEditable" Value="False" />
    <Setter Property="MaxDropDownHeight" Value="{x:Static System:Double.PositiveInfinity}" />
  </Style>
  <ControlTemplate x:Key="BackstageControlTemplate" TargetType="{x:Type Fluent:BackstageTabControl}">
    <ControlTemplate.Resources>
      <ResourceDictionary>
        <Style x:Key="{x:Type Fluent:Button}" TargetType="{x:Type Fluent:Button}" BasedOn="{StaticResource BackstageButtonStyle}" />
        <Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}" BasedOn="{StaticResource ScrollBarWhite}" />
        <Style x:Key="{x:Type Fluent:DropDownButton}" TargetType="{x:Type Fluent:DropDownButton}" BasedOn="{StaticResource DropDownButtonBackstageStyle}" />
        <Style x:Key="{x:Type Fluent:ComboBox}" TargetType="{x:Type Fluent:ComboBox}" BasedOn="{StaticResource ComboBoxBackstageStyle}" />
        <Style x:Key="{x:Type Fluent:Spinner}" TargetType="{x:Type Fluent:Spinner}" BasedOn="{StaticResource SpinnerBackstageStyle}" />
        <Style TargetType="{x:Type Fluent:SeparatorTabItem}" BasedOn="{StaticResource BackstageSeparatorTabItemStyle}" />
      </ResourceDictionary>
    </ControlTemplate.Resources>
    <Grid Margin="0" Background="{StaticResource BackstageBackgroundBrush}">
      <Grid.ColumnDefinitions>
        <ColumnDefinition MinWidth="107" Width="Auto" />
        <ColumnDefinition Width="*" />
      </Grid.ColumnDefinitions>
      <Grid Height="Auto" Grid.Column="1">
        <Grid.Resources>
          <ResourceDictionary>
            <Style x:Key="{x:Type Fluent:Button}" TargetType="{x:Type Fluent:Button}" BasedOn="{StaticResource ButtonBackstageStyle}" />
          </ResourceDictionary>
        </Grid.Resources>
        <Border HorizontalAlignment="Right" Margin="-100,0,0,0" VerticalAlignment="Bottom" Width="343" Height="181" Background="{TemplateBinding Background}" BorderThickness="0" SnapsToDevicePixels="True">
          <Image x:Name="image" Source="/Fluent;Component/Themes/Office2010/Images/BackstageCorner.png" Stretch="None" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="343" Height="181" SnapsToDevicePixels="True" RenderTransformOrigin="0.5,0.5">
            <Image.RenderTransform>
              <TransformGroup>
                <ScaleTransform />
                <SkewTransform />
                <RotateTransform />
                <TranslateTransform />
              </TransformGroup>
            </Image.RenderTransform>
          </Image>
        </Border>
        <ContentPresenter x:Name="PART_SelectedContentHost" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Height="Auto" Grid.Column="1" ContentSource="SelectedContent" />
      </Grid>
      <Grid Margin="0" VerticalAlignment="Stretch" Background="{TemplateBinding ItemsPanelBackground}">
        <Border HorizontalAlignment="Right" Margin="0" Width="6" Height="Auto" BorderBrush="{StaticResource RibbonTopBorderBrush}" BorderThickness="0,0,1,0" Background="{StaticResource BackstagePanelShadowBackgroundBrush}" />
        <ItemsPresenter Margin="0,5,0,0" Height="Auto" />
      </Grid>
      <Border Margin="0" VerticalAlignment="Top" Height="2" Grid.ColumnSpan="2" Background="{TemplateBinding Background}" OpacityMask="{StaticResource BackstageTopOpacityBrush}">
        <Rectangle Stroke="{x:Null}" StrokeThickness="0" Fill="{StaticResource BackstageTopBackgroundBrush}" />
      </Border>
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="FlowDirection" Value="RightToLeft">
        <Setter Property="RenderTransform" TargetName="image">
          <Setter.Value>
            <TransformGroup>
              <ScaleTransform ScaleX="-1" />
              <SkewTransform />
              <RotateTransform />
              <TranslateTransform />
            </TransformGroup>
          </Setter.Value>
        </Setter>
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <Style x:Key="BackstageStyle" TargetType="{x:Type Fluent:BackstageTabControl}">
    <Setter Property="Foreground" Value="{StaticResource DefaultFontBrush}" />
    <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}" />
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
    <Setter Property="Template" Value="{StaticResource BackstageControlTemplate}" />
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlStyleEmptyFocus}" />
    <Setter Property="Background" Value="{Binding Background, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:Backstage}}, FallbackValue=Red}" />
    <Setter Property="ItemsPanelBackground" Value="{StaticResource BackstagePanelBackgroundBrush}" />
  </Style>
  <ControlTemplate x:Key="NonDwmRibbonWindowControlTemplate" TargetType="{x:Type Fluent:RibbonWindow}">
    <Grid>
      <AdornerDecorator x:Name="adornerDecorator" VerticalAlignment="Stretch" Margin="0">
        <Grid>
          <Border x:Name="PART_SizeBorder" BorderBrush="{StaticResource WindowOutterBorderBrush}" BorderThickness="1,1,1,1" CornerRadius="8.5" Opacity="1" Background="{StaticResource WindowOutterBackgroundBrush}">
            <Border x:Name="border2" BorderBrush="{StaticResource WindowInnerBorderBrush}" BorderThickness="1,1,1,1" CornerRadius="7,7,7,7" Background="{x:Null}" Opacity="1">
              <Border x:Name="border3" BorderBrush="{x:Null}" BorderThickness="0,0,0,0" Opacity="1" CornerRadius="6" VerticalAlignment="Top" Height="50" Background="{StaticResource WindowInnerBackgroundBrush}" />
            </Border>
          </Border>
          <Grid x:Name="PART_MainGrid" Margin="0" Background="#00FFFFFF">
            <Grid x:Name="PART_TitleBar" Margin="{TemplateBinding ResizeBorderThickness}" VerticalAlignment="Top" Height="{TemplateBinding CaptionHeight}" Background="#00FFFFFF" IsHitTestVisible="True" />
            <StackPanel Background="Transparent" x:Name="PART_IconImage" Margin="8,7,0,0" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Top">
              <Image x:Name="iconImage" Height="16" HorizontalAlignment="Left" VerticalAlignment="Top" Source="{Binding Icon, Converter={StaticResource IconConvert}, RelativeSource={RelativeSource TemplatedParent}}" Width="16" SnapsToDevicePixels="True" Stretch="Uniform" />
            </StackPanel>
            <StackPanel x:Name="PART_ButtonsPanel" HorizontalAlignment="Right" Margin="0,8,8,0" VerticalAlignment="Top" Orientation="Horizontal">
              <Button x:Name="minimizeButton" Style="{StaticResource CaptionButtonStyle}" Width="35" Height="19" BorderThickness="1,0,0,1" Command="{x:Static Fluent:RibbonWindow.MinimizeCommand}">
                <Image Width="Auto" Height="Auto" HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="None" Source="{StaticResource ImageCaptionButtonMinimize}" SnapsToDevicePixels="True" />
              </Button>
              <Button x:Name="maximizeButton" Margin="-1,0,0,0" Style="{StaticResource CaptionButtonStyle}" Width="35" Height="19" BorderThickness="0,0,0,1" Command="{x:Static Fluent:RibbonWindow.MaximizeCommand}">
                <Image Width="Auto" Height="Auto" HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="None" Source="{StaticResource ImageCaptionButtonMaximize}" SnapsToDevicePixels="True" />
              </Button>
              <Button x:Name="normalizeButton" Margin="-1,0,0,0" Style="{StaticResource CaptionButtonStyle}" Width="35" Height="19" BorderThickness="0,0,0,1" Command="{x:Static Fluent:RibbonWindow.NormalizeCommand}">
                <Image Width="Auto" Height="Auto" HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="None" Source="{StaticResource ImageCaptionButtonNormalize}" SnapsToDevicePixels="True" />
              </Button>
              <Button x:Name="closeButton" Margin="-1,0,0,0" Style="{StaticResource CaptionButtonStyle}" Width="35" Height="19" BorderThickness="0,0,1,1" Background="Red" Command="{x:Static Fluent:RibbonWindow.CloseCommand}">
                <Image Width="Auto" Height="Auto" HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="None" Source="{StaticResource ImageCaptionButtonClose}" SnapsToDevicePixels="True" />
              </Button>
            </StackPanel>
            <Border x:Name="border4" Margin="{TemplateBinding GlassBorderThickness}">
              <Border x:Name="border1" Height="Auto" BorderThickness="1,1,1,1" BorderBrush="{StaticResource WindowContentBorderBrush}" Margin="-1">
                <Grid x:Name="grid" Background="{TemplateBinding Background}" />
              </Border>
            </Border>
            <ContentPresenter Margin="8,1,8,8" x:Name="contentPresenter" />
            <ResizeGrip x:Name="PART_ResizeGrip" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Bottom" Focusable="False" Margin="0,0,5.5,5.5" Cursor="SizeNWSE" Visibility="Collapsed" />
          </Grid>
        </Grid>
      </AdornerDecorator>
    </Grid>
    <ControlTemplate.Triggers>
      <Trigger Property="IsNonClientAreaActive" Value="False">
        <Setter Property="Background" TargetName="PART_SizeBorder" Value="{StaticResource WindowInactiveOutterBackgroundBrush}" />
        <Setter Property="Background" TargetName="border3" Value="{StaticResource WindowInactiveInnerBackgroundBrush}" />
      </Trigger>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="ResizeMode" Value="CanResizeWithGrip" />
          <Condition Property="WindowState" Value="Normal" />
        </MultiTrigger.Conditions>
        <Setter Property="Visibility" TargetName="PART_ResizeGrip" Value="Visible" />
      </MultiTrigger>
      <Trigger Property="WindowState" Value="Maximized">
        <Setter Property="Margin" TargetName="iconImage" Value="0,4,0,0" />
        <Setter Property="BorderThickness" TargetName="PART_SizeBorder" Value="0,0,0,0" />
        <Setter Property="CornerRadius" TargetName="PART_SizeBorder" Value="0,0,0,0" />
        <Setter Property="BorderThickness" TargetName="border2" Value="0,0,0,0" />
        <Setter Property="CornerRadius" TargetName="border2" Value="0,0,0,0" />
        <Setter Property="Margin" TargetName="PART_ButtonsPanel" Value="0,8,8,0" />
        <Setter Property="Visibility" TargetName="maximizeButton" Value="Collapsed" />
        <Setter Property="Margin" TargetName="adornerDecorator" Value="0" />
        <Setter Property="Margin" TargetName="contentPresenter" Value="8,6,8,8" />
        <Setter Property="Height" TargetName="border2" Value="54" />
      </Trigger>
      <Trigger Property="WindowState" Value="Normal">
        <Setter Property="Visibility" TargetName="normalizeButton" Value="Collapsed" />
      </Trigger>
      <Trigger Property="IsIconVisible" Value="False">
        <Setter Property="Visibility" TargetName="PART_IconImage" Value="Collapsed" />
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <Style x:Key="RibbonWindowStyle" TargetType="{x:Type Fluent:RibbonWindow}">
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
    <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}" />
    <Setter Property="FontWeight" Value="Normal" />
    <Setter Property="GlassBorderThickness" Value="8,50,8,8" />
    <Setter Property="ResizeBorderThickness" Value="8,8,8,8" />
    <Setter Property="CornerRadius" Value="15" />
    <Setter Property="CaptionHeight" Value="50" />
    <Setter Property="Foreground" Value="#FF000000" />
    <Setter Property="Background" Value="{StaticResource WindowBackgroundBrush}" />
    <Style.Triggers>
      <Trigger Property="IsCollapsed" Value="True">
        <Setter Property="GlassBorderThickness" Value="8,30,8,8" />
      </Trigger>
      <Trigger Property="WindowState" Value="Maximized">
        <Setter Property="GlassBorderThickness" Value="0,56,0,0" />
      </Trigger>
      <Trigger Property="IsDwmEnabled" Value="False">
        <Setter Property="Template" Value="{StaticResource NonDwmRibbonWindowControlTemplate}" />
      </Trigger>
      <Trigger Property="IsDwmEnabled" Value="True">
        <Setter Property="Template" Value="{StaticResource DwmRibbonWindowControlTemplate}" />
      </Trigger>
    </Style.Triggers>
  </Style>
  <Style x:Key="{x:Type Fluent:BackstageTabControl}" TargetType="{x:Type Fluent:BackstageTabControl}" BasedOn="{StaticResource BackstageStyle}" />
  <Style x:Key="{x:Type Fluent:RibbonWindow}" TargetType="{x:Type Fluent:RibbonWindow}" BasedOn="{StaticResource RibbonWindowStyle}" />
  <Style x:Key="RibbonGroupBoxStyle" TargetType="{x:Type Fluent:RibbonGroupBox}">
    <Setter Property="Template" Value="{StaticResource RibbonGroupBoxControlTemplate}" />
    <Setter Property="Width" Value="Auto" />
    <Setter Property="Height" Value="85" />
    <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}" />
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
    <Setter Property="Foreground" Value="{StaticResource DefaultFontBrush}" />
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlStyleEmptyFocus}" />
    <Setter Property="FocusManager.IsFocusScope" Value="False" />
    <!--<Setter Property="QuickAccessElementStyle" Value="{DynamicResource RibbonGroupBoxQuickAccessStyle}"/>-->
    <Style.Triggers>
      <Trigger Property="State" Value="QuickAccess">
        <Setter Property="Template" Value="{StaticResource RibbonGroupBoxDropDownButtonControlTemplate}" />
        <Setter Property="Height" Value="22" />
        <Setter Property="Width" Value="22" />
        <Setter Property="Focusable" Value="False" />
        <Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
        <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}" />
        <Setter Property="Foreground" Value="{StaticResource DefaultFontBrush}" />
        <Setter Property="FocusVisualStyle" Value="{StaticResource ControlStyleEmptyFocus}" />
        <Setter Property="SnapsToDevicePixels" Value="False" />
      </Trigger>
    </Style.Triggers>
  </Style>
  <Style x:Key="RibbonDropDownButtonStyle" TargetType="{x:Type Fluent:DropDownButton}">
    <Setter Property="Template" Value="{StaticResource RibbonDropDownButtonControlTemplate}" />
    <Setter Property="Height" Value="68" />
    <Setter Property="Width" Value="Auto" />
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
    <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}" />
    <Setter Property="Foreground" Value="{StaticResource DefaultFontBrush}" />
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlStyleEmptyFocus}" />
    <Setter Property="SnapsToDevicePixels" Value="False" />
    <Style.Triggers>
      <Trigger Property="Size" Value="Large">
        <Setter Property="Height" Value="68" />
      </Trigger>
      <Trigger Property="Size" Value="Middle">
        <Setter Property="Height" Value="22" />
      </Trigger>
      <Trigger Property="Size" Value="Small">
        <Setter Property="Height" Value="22" />
        <Setter Property="Width" Value="31" />
      </Trigger>
    </Style.Triggers>
  </Style>
  <Style x:Key="RibbonSplitButtonStyle" TargetType="{x:Type Fluent:SplitButton}">
    <Setter Property="Template" Value="{StaticResource RibbonSplitButtonControlTemplate}" />
    <Setter Property="Height" Value="68" />
    <Setter Property="Width" Value="Auto" />
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
    <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}" />
    <Setter Property="Foreground" Value="{StaticResource DefaultFontBrush}" />
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlStyleEmptyFocus}" />
    <Setter Property="SnapsToDevicePixels" Value="True" />
    <Style.Triggers>
      <Trigger Property="Size" Value="Large">
        <Setter Property="Height" Value="68" />
      </Trigger>
      <Trigger Property="Size" Value="Middle">
        <Setter Property="Height" Value="22" />
      </Trigger>
      <Trigger Property="Size" Value="Small">
        <Setter Property="Height" Value="22" />
        <Setter Property="Width" Value="34" />
      </Trigger>
    </Style.Triggers>
  </Style>
  <Style x:Key="QuickAccessToolbarStyle" TargetType="{x:Type Fluent:QuickAccessToolBar}">
    <Setter Property="Template" Value="{StaticResource QuickAccessToolbarControlTemplate}" />
    <Setter Property="FocusManager.IsFocusScope" Value="False" />
  </Style>
  <Style TargetType="{x:Type Fluent:ContextMenu}">
    <Setter Property="Template" Value="{StaticResource FluentPopupMenuControlTemplate}" />
    <Setter Property="Foreground" Value="{StaticResource DefaultFontBrush}" />
    <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}" />
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
    <Setter Property="MinWidth" Value="0" />
    <Setter Property="MinHeight" Value="0" />
    <Setter Property="HorizontalAlignment" Value="Left" />
    <Setter Property="VerticalAlignment" Value="Top" />
  </Style>
  <Style TargetType="{x:Type ContextMenu}">
    <Setter Property="Template" Value="{StaticResource PopupMenuControlTemplate}" />
    <Setter Property="Foreground" Value="{StaticResource DefaultFontBrush}" />
    <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}" />
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
    <Setter Property="MinWidth" Value="0" />
    <Setter Property="MinHeight" Value="0" />
    <Setter Property="HorizontalAlignment" Value="Left" />
    <Setter Property="VerticalAlignment" Value="Top" />
  </Style>
  <ControlTemplate x:Key="RibbonControlTemplate" TargetType="{x:Type Fluent:Ribbon}">
    <Grid x:Name="PART_LayoutRoot" Width="Auto" Height="Auto">
      <Grid.RowDefinitions>
        <RowDefinition Height="*" />
        <RowDefinition Height="Auto" />
      </Grid.RowDefinitions>
      <!-- When you change the default height of 25 of the RibbonTitleBar to something else, don't forget to change it in code behind (see OnIsCollapsedChanged) -->
      <Fluent:RibbonTitleBar x:Name="PART_RibbonTitleBar" Height="25" Style="{StaticResource RibbonTitleBarStyle}" Margin="20,0,113,0" VerticalAlignment="Top" IsCollapsed="{TemplateBinding IsCollapsed}">
        <Fluent:RibbonTitleBar.Header>
          <Grid>
            <Rectangle x:Name="rectangle" Fill="#7FFFFFFF" Stroke="{x:Null}" StrokeThickness="0" HorizontalAlignment="Center" VerticalAlignment="Center" Width="{Binding ActualWidth, ElementName=PART_Title, Mode=Default}" Height="{Binding ActualHeight, ElementName=PART_Title, Mode=Default}" RadiusX="2" RadiusY="2">
              <Rectangle.Effect>
                <BlurEffect Radius="10" />
              </Rectangle.Effect>
            </Rectangle>
            <TextBlock x:Name="PART_Title" Padding="4,0,4,0" VerticalAlignment="Center" d:LayoutOverrides="Width" HorizontalAlignment="Center" Text="{Binding Path=Title,RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" Foreground="Black" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" />
          </Grid>
        </Fluent:RibbonTitleBar.Header>
      </Fluent:RibbonTitleBar>
      <Fluent:RibbonTabControl Menu="{TemplateBinding Menu}" Style="{StaticResource RibbonTabControlStyle}" x:Name="PART_RibbonTabControl" Margin="0,25,0,0" Focusable="False" ContextMenu="{Binding ContextMenu, ElementName=PART_LayoutRoot}" />
      <!--<ContentPresenter x:Name="button" Margin="2,26,0,0" HorizontalAlignment="Left" VerticalAlignment="Top"
                          ContentSource="Menu"/>-->
      <Border x:Name="border" Margin="0,-2,0,0" BorderBrush="{StaticResource QuickAccessToolBarOutterBorderBrush}" BorderThickness="0,1" Grid.Row="1" Height="26">
        <Border BorderBrush="{StaticResource QuickAccessToolBarInnerBorderBrush}" BorderThickness="0,1" Background="{StaticResource QuickAccessToolBarInnerBackgroundBrush}">
          <ContentControl x:Name="contentControl" HorizontalAlignment="Left">
            <Fluent:QuickAccessToolBar x:Name="PART_QuickAccessToolBar" Style="{StaticResource QuickAccessToolbarStyle}" ShowAboveRibbon="{Binding ShowQuickAccessToolBarAboveRibbon, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" HorizontalAlignment="Left" Focusable="False" />
          </ContentControl>
        </Border>
      </Border>
    </Grid>
    <ControlTemplate.Triggers>
      <!--<Trigger Property="CanQuickAccessLocationChanging" Value="False">
        <Setter Property="Visibility" TargetName="PART_ShowQuickAccessToolbarBelowTheRibbonMenuItem" Value="Collapsed"/>
        <Setter Property="Visibility" TargetName="PART_ShowQuickAccessToolbarAboveTheRibbonMenuItem" Value="Collapsed"/>
        <Setter Property="Visibility" TargetName="separator" Value="Collapsed"/>
      </Trigger>-->
      <Trigger Property="IsQuickAccessToolBarVisible" Value="False">
        <Setter Property="Visibility" TargetName="border" Value="Collapsed" />
        <Setter Property="Visibility" TargetName="PART_QuickAccessToolBar" Value="Collapsed" />
        <!--<Setter Property="Visibility" TargetName="PART_ShowQuickAccessToolbarBelowTheRibbonMenuItem" Value="Collapsed"/>
        <Setter Property="Visibility" TargetName="PART_ShowQuickAccessToolbarAboveTheRibbonMenuItem" Value="Collapsed"/>
        <Setter Property="Visibility" TargetName="PART_RemoveFromQuickAccessMenuItem" Value="Collapsed"/>
        <Setter Property="Visibility" TargetName="PART_AddGalleryToQuickAccessMenuItem" Value="Collapsed"/>
        <Setter Property="Visibility" TargetName="PART_AddMenuToQuickAccessMenuItem" Value="Collapsed"/>
        <Setter Property="Visibility" TargetName="PART_AddGroupToQuickAccessMenuItem" Value="Collapsed"/>
        <Setter Property="Visibility" TargetName="PART_AddToQuickAccessMenuItem" Value="Collapsed"/>
        <Setter Property="Visibility" TargetName="separator" Value="Collapsed"/>
        <Setter Property="Visibility" TargetName="topMenuSeparator" Value="Collapsed"/>-->
      </Trigger>
      <Trigger Property="IsCollapsed" Value="True">
        <Setter Property="Visibility" TargetName="PART_RibbonTabControl" Value="Collapsed" />
        <Setter Property="Visibility" TargetName="border" Value="Collapsed" />
      </Trigger>
      <Trigger Property="ShowQuickAccessToolBarAboveRibbon" Value="True">
        <Setter Property="Content" TargetName="contentControl" Value="{x:Null}" />
        <Setter Property="QuickAccessToolBar" TargetName="PART_RibbonTitleBar" Value="{Binding ElementName=PART_QuickAccessToolBar, Mode=OneWay}" />
        <Setter Property="Visibility" TargetName="border" Value="Collapsed" />
        <Setter Property="Margin" TargetName="PART_QuickAccessToolBar" Value="0,2,0,0" />
      </Trigger>
      <!--<MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="Visibility" Value="Collapsed" SourceName="PART_AddToQuickAccessMenuItem"/>
          <Condition Property="Visibility" Value="Collapsed" SourceName="PART_AddGroupToQuickAccessMenuItem"/>
          <Condition Property="Visibility" Value="Collapsed" SourceName="PART_AddMenuToQuickAccessMenuItem"/>
          <Condition Property="Visibility" Value="Collapsed" SourceName="PART_AddGalleryToQuickAccessMenuItem"/>
          <Condition Property="Visibility" Value="Collapsed" SourceName="PART_RemoveFromQuickAccessMenuItem"/>
        </MultiTrigger.Conditions>
        <Setter Property="Visibility" Value="Collapsed" TargetName="topMenuSeparator"/>
      </MultiTrigger>-->
      <!--<Trigger Property="ShowQuickAccessToolBarAboveRibbon" Value="True">
        <Setter Property="Visibility" TargetName="PART_ShowQuickAccessToolbarAboveTheRibbonMenuItem" Value="Collapsed"/>
      </Trigger>
      <Trigger Property="ShowQuickAccessToolBarAboveRibbon" Value="False">
        <Setter Property="Visibility" TargetName="PART_ShowQuickAccessToolbarBelowTheRibbonMenuItem" Value="Collapsed"/>
      </Trigger>
      <Trigger Property="CanCustomizeQuickAccessToolBar" Value="False">
        <Setter Property="Visibility" TargetName="PART_CustomizeQuickAccessToolbarMenuItem" Value="Collapsed"/>
      </Trigger>
      <Trigger Property="CanCustomizeRibbon" Value="False">
        <Setter Property="Visibility" TargetName="PART_CustomizeTheRibbonMenuItem" Value="Collapsed"/>
      </Trigger>-->
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <Style x:Key="RibbonStyle" TargetType="{x:Type Fluent:Ribbon}">
    <Setter Property="Foreground" Value="{StaticResource DefaultFontBrush}" />
    <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}" />
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSize}" />
    <Setter Property="Template" Value="{StaticResource RibbonControlTemplate}" />
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlStyleEmptyFocus}" />
    <Setter Property="FocusManager.IsFocusScope" Value="False" />
    <Setter Property="VerticalAlignment" Value="Top" />
    <Setter Property="IsTabStop" Value="False" />
    <Setter Property="Fluent:FrameworkHelper.UseLayoutRounding" Value="True" />
  </Style>
  <Style x:Key="{x:Type Fluent:DropDownButton}" TargetType="{x:Type Fluent:DropDownButton}" BasedOn="{StaticResource RibbonDropDownButtonStyle}" />
  <Style x:Key="{x:Type Fluent:SplitButton}" TargetType="{x:Type Fluent:SplitButton}" BasedOn="{StaticResource RibbonSplitButtonStyle}" />
  <Style x:Key="{x:Type Fluent:RibbonGroupBox}" TargetType="{x:Type Fluent:RibbonGroupBox}" BasedOn="{StaticResource RibbonGroupBoxStyle}" />
  <Style x:Key="{x:Type Fluent:Ribbon}" TargetType="{x:Type Fluent:Ribbon}" BasedOn="{StaticResource RibbonStyle}" />
</ResourceDictionary>